Can't import Angular libraries


#1

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";
@Component({
    selector: "my-app",
    template: `<h1>{{title}}</h1>`
})
class AppComponent { }

@NgModule({
    declarations: [AppComponent],
    imports: [BrowserModule],
    bootstrap: [AppComponent]    
}) 

class AppModule{
    title: "Ultra Racing"
}

platformBrowserDynamic().bootstrapModule(AppModule);

this is my html:

<!DOCTYPE html>
<html>
  <head>
    <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">
    </script>
  </head>

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

Can anybody help me?


#2

Are you using NativeScript?

Looks like a web app to me.