【发布时间】:2017-07-10 15:46:30
【问题描述】:
我是 Angular 的新手。我正在尝试使用 Visual Studio 2015 创建一个 Angular 应用程序。如 here 所述,我已经安装了在 VS2015 中使用 Angular 所需的所有要求和配置。
我已经学习了 Angular 的基础知识。现在我需要继续使用 Angular 示例项目来深入学习。
在我的第一个示例项目中,我有三个 .ts(transcript) 文件,
主要.ts
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './boot';
const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule);
boot.ts
///<reference path="./../typings/globals/core-js/index.d.ts"/>
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app';
@NgModule({
imports: [BrowserModule],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule { }
app.ts
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `
<h2>My favorite skill is: {{myskills}}</h2>
<p>Skill:</p>
<ul>
<li *ngFor="let skl of skills">
{{ skl }}
</li>
</ul>
`
})
export class AppComponent {
title = 'ASP.NET MVC 5 with Angular 2';
skills = ['MVC 5', 'Angular 2', 'TypeScript', 'Visual Studio 2015'];
myskills = this.skills[1];
}
我很困惑是先在 app.ts 中创建组件还是在 boot.ts 等中创建模块。
1.) 在使用 Angular 之前我需要学习打字稿吗?
2.) 喜欢我可以获取示例项目以学习这些基础知识的链接。
3.) 任何从零开始学习的书籍。
【问题讨论】:
-
在使用 Angular 之前我需要学习 typescript 吗? 是的。
标签: angular visual-studio-2015