angular学习之旅
前面是六颗星星
前面是六颗星星
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
angular---依赖注入
1 通过@Injectable装饰器注入,让引用此模块的使用 // hero.service.ts import { Injectable } from '@angular/core'; //导入依赖注入模块 import { HEROES } from './mock-heroes'; @Injectable({ /* 'root':在大多数应用程序中是指应用程序级注入器。 'platform' :页面上所有应用程序共享的平台注入器的特殊单例。 'any':在每个惰性加载的模块中提供一个唯.原创 2021-07-25 21:31:34 · 282 阅读 · 0 评论 -
angular--零碎知识记录
在ng g c 时不生成测试spec.ts文件 ng g c sontwo/comptestss334555 --skip-tests原创 2021-07-25 17:50:44 · 164 阅读 · 0 评论 -
angular---rxjs
在angular中基础用法 import {Observable} from 'rxjs'; //导入rxjs模块 import { map, filter, scan } from 'rxjs/operators'; //按需导入需要的操作符 of(1, 2, 3) //创建一个可观察对象 .pipe( //通过pipe管道符来先处理数据 filter((value)=>{ if(value % 2 === 0){ return true } .原创 2021-07-25 17:20:09 · 218 阅读 · 0 评论 -
angular-http发送请求
//module.ts 文件 @NgModule({ declarations: [AppComponent], imports: [BrowserModule, HttpClientModule, HttpClientJsonpModule], providers: [], bootstrap: [AppComponent] }) export class AppModule {} //component.ts 文件 import {HttpClient,HttpClientJ...原创 2021-07-25 13:11:51 · 913 阅读 · 0 评论
分享