angular2和typescript 和npm

angular2须要用到typescript   和 npm
 
下载项目 到本地文件夹switching-to-angular2
2. cd  switching-to-angular2
3. npm install 下载
5. npm start启动后,就能够访问下载的项目中的路径 http://localhost:5555/dist/dev  能够看到项目的列表
 
 
 
组件里能够包含template 模板,  templateUrl 指向一个页面url,指令dirctives,样式style
 
@Component({
selector: "carTag",
template: `<h3 class="titles">Mother Car Component</h3>
<input type ="text" #textInput bind-value="text" />
<button on-click="onCarChange(textInput.value)">Change</button>`,
directives: [door],
styles:[ `
.titles {color:#0099FF }
.child-style {
background-attachment: initial; background-size: initial; background-origin: initial; background-clip: initial; background-position: initial; background-repeat: initial;"> }
`]
})
相关文章
相关标签/搜索