0

I am following 5 Min Quickstart in Angular2. When I am starting npm, in browser it's showing only Loading...

app.component.ts-

import { Component } from '@angular/core';
@Component({
  selector: 'my-app',
  template: '<h1>My First Angular 2 App</h1>'
})
export class AppComponent { }

app.module.ts

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

main.ts

import { platformBrowserDynamic } from '@angular/platform-browser- dynamic';
import { AppModule } from './app.module';
platformBrowserDynamic().bootstrapModule(AppModule);

index.html

<html>
<head>
<title>Angular 2 QuickStart</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<!-- 1. Load libraries -->
 <!-- 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/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<!-- 2. Configure SystemJS -->
<script src="systemjs.config.js"></script>
<script>
  System.import('app').catch(function(err){ console.error(err); });
</script>
</head>
<!-- 3. Display the application -->
<body>
  <my-app>Loading...</my-app>
</body>
</html>
Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
deen
  • 2,185
  • 7
  • 29
  • 53
  • 1
    console error please, though `'@angular/platform-browser-dynamic;` missing `'` quote at the end, should be `'@angular/platform-browser-dynamic';` – Pankaj Parkar Aug 24 '16 at 09:12
  • thanx for response, it was typing mistake, still not getting desire output. – deen Aug 24 '16 at 09:23
  • I asked, is there any error in console? or any compile time error in whatever IDE you are using? – Pankaj Parkar Aug 24 '16 at 09:30
  • this error is showing on console- error TS2304: Cannot find name 'Set', – deen Aug 24 '16 at 09:33
  • you are missing something while setup, please refer [this answer](http://stackoverflow.com/a/39117075/2435473) would help you, Thanks :) – Pankaj Parkar Aug 24 '16 at 09:35
  • now I'm getting, Did not detect a `bs-config.json` or `bs-config.js` override file. Using lite-server defaults... – deen Aug 24 '16 at 09:42

0 Answers0