-1
为了在角1.XX来引导我们如何补救angularJS 2?
ng-app ="myApp"
和js文件,我们写
var app = angular.module('myApp',[]);
我们如何能够引导在角2?
为了在角1.XX来引导我们如何补救angularJS 2?
ng-app ="myApp"
和js文件,我们写
var app = angular.module('myApp',[]);
我们如何能够引导在角2?
您可以使用Angular-CLI和以下命令。
npm install -g angular-cli
ng new PROJECT_NAME
cd PROJECT_NAME
ng serve
import {bootstrap} from "angular2/platform/browser";
import {Component} from "angular2/core";
@Component({
selector: 'my-app',
template: '<h1>My application</h1>'
})
class App{}
bootstrap(App);
它来引导你的应用程序最简单的方法。但好的做法是分离你的组件和引导文件。 查看此视频小课程:https://egghead.io/lessons/angular-2-say-hello-world-to-angular-2?course=angular-2-fundamentals
你看过https://angular.io/docs/ts/latest/quickstart.html吗?这比1.x更复杂 –
我会看看这个链接。 – Prateik