随笔分类 - Angular
摘要:封装服务: httpservice.service.ts 在app.module.ts中使用: providers: [HttpserviceService], 2. app.module.ts http.component.ts http.component.html
阅读全文
摘要:app.module.ts request.service.ts request-home.component.ts
阅读全文
摘要:组件 lifecycle.html lifecycle.ts app.component.html app.component.ts app.module.ts
阅读全文
摘要:父组件给子组件传值-@input 父组件 home.html homt.ts 子组件header: header.html header.ts 父组件获取子组件的属性和方法: 父组件new.html new.ts 子组件: footer.html footer.ts 二、子组件通过@Output触发
阅读全文
摘要:2.Angular 中的 dom 操作(ViewChild) 三、父子组件中通过 ViewChild 调用子组件的方法
阅读全文
摘要:storage.service.ts 使用:
阅读全文
摘要:1.app.module.ts中: import { FormsModule } from "@angular/forms"; imports:{ FormsModule ] FormsModule 案例: HTML <h2>人员登记系统</h2> <div class="people_list">
阅读全文
摘要:新建项目: ng new angualrdermo08 --skip-install 新建项目不进行安装项目依赖ng new todoList --skip-install --routing=true --style=scss 新建项目不安装依赖,安装路由,并制定所需的样式 创建需要的组件: ng
阅读全文
摘要:创建组件: ng g component components/news 一、创建 angualr 组件..................................................................................................
阅读全文
摘要:一、目录结构分析 二、 app.module.ts、组件分析 1.app.module.ts 定义 AppModule,这个根模块会告诉 Angular 如何组装该应用。 目前,它只声明了 AppComponent。 稍后它还会声明更多组件。 一、目录结构分析 一、目录结构分析 二、 app.mod
阅读全文
摘要:1.安装node.js 和cnpm 2.cnpm install -g @angular/cli 安装angular脚手架: 3.ng new angulardemo cd angulardemo cnpm install ng serve --open
阅读全文