Can't import Angular libraries


I am trying to import some angular libraries to my code, but when i run it, i get an error that says this:

SyntaxError: import declarations may only appear at top level of a module
Here is my typescript code:
import {NgModule, Component} from "@angular/core";
import {BrowserModule} from "@angular/platform-browser";
import {platformBrowserDynamic} from "@angular/platform-browser-dynamic";
    selector: "my-app",
    template: `<h1>{{title}}</h1>`
class AppComponent { }

    declarations: [AppComponent],
    imports: [BrowserModule],
    bootstrap: [AppComponent]    

class AppModule{
    title: "Ultra Racing"


this is my html:

<!DOCTYPE html>
    <title>Angular QuickStart</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="styles.css">

    <!-- Polyfill(s) for older browsers -->
    <script src="../node_modules/core-js/client/shim.min.js"></script>

    <script src="../node_modules/zone.js/dist/zone.js"></script>
    <script src="../node_modules/systemjs/dist/system.src.js"></script>

    <script src="systemjs.config.js"></script>
    <script src="main.ts">

    <my-app>Loading App...</my-app>

Can anybody help me?


Are you using NativeScript?

Looks like a web app to me.