Angular
Steven_1104
这个作者很懒,什么都没留下…
展开
-
Angular:创建一个angular项目(一)
1、进入要创建项目的目录,在cmd命令框中输入:ng new +项目名称ng new angulardemo012.查看文件夹3.使用VS Code导入项目4.在终端运行项目 ng serve --open5.运行成功6.结束运行:ctrl + c...原创 2019-05-01 21:30:55 · 10777 阅读 · 0 评论 -
Angular:创建使用组件(二)
一、创建组件1.创建一个 news组件ng g component [组件目录/组件名称]ng g component components/news2.在VS Code中查看项目结构3.如果通过命令行创建组件,将自动在 app.module.ts 中引入二、使用组件1.在 app.component.html 中添加 news 组件<!--The content b...原创 2019-05-01 21:31:11 · 396 阅读 · 0 评论 -
Angular:组件及组件里的模板(三)
一、创建angular组件1.创建组件ng g component components/news2.使用组件app.component.html<app-news></app-news>二、angular 绑定数据1.数据文本绑定news.component.tsexport class NewsComponent implements OnInit...原创 2019-05-01 21:31:24 · 550 阅读 · 1 评论 -
Angular:实现一个人员登记表单-案例(四)
效果展示:创建组件:ng g component components/formapp.module.tsimport { BrowserModule } from '@angular/platform-browser';import { NgModule } from '@angular/core';import { FormsModule } from '@angular/fo...原创 2019-05-01 21:31:37 · 247 阅读 · 0 评论 -
mac:安装node、npm和angular cli
1.使用curl或wget安装nvmcurl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh|bashorwget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh|bash2.使用nvm ins...原创 2019-05-01 21:30:26 · 587 阅读 · 0 评论