angular8
菠菜盼娣
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
angular8 路由相关
路由使用前提 1 创建组件 2 引入组件(app.module.ts) 3 app.routing.ts中引入组件 4 配置路由 路由配置 const routes:Routes=[ {path:'home',component:HomeComponent}, {path:'news',component:NewsComponent}, {path:'**',redirectTo:'home'},...原创 2020-04-21 09:12:10 · 352 阅读 · 0 评论 -
angular8请求 公共IP
内置模块 HttpClient get请求 app.module.ts import {HttpClientModlue} from "@angular/common/http" imports:[HttpClientModule] 用到的地方引入HttpClient import {HttpClient } from "@angular/common/http" constructor(pu...原创 2020-04-20 16:31:39 · 543 阅读 · 0 评论 -
angular8 父子组件之间的通信 @ViewChild @Input
@ViewChild 在父组件中调用子组件 头部组件用到新闻组件中 news <app-header #header></app-header> <button (click)="getChildClick()"> new.ts import {ViewChild} from "@angular/core" @ViewChild('header') heade...原创 2020-04-20 15:34:47 · 316 阅读 · 0 评论 -
angular8数据持久化 获取DOM节点
服务 localstorage 1 创建服务 ng g service services/storage 2 app.modules.t中引入配置 import {StorageService} from './services/storage.service' provides:[StorageService] 3 在使用的地方 import {StorageService} from ...原创 2020-04-20 15:10:37 · 534 阅读 · 0 评论 -
angular8组件新增,基本语法,双向数据绑定
angular8 1 新增组件 创建 ng g component components/news 引入 import NewsComponent from '../../components/news' 使用 <app-news></app-news> 2 生明变量 public private protected any string 等 p...原创 2020-04-20 14:50:27 · 807 阅读 · 0 评论
分享