摘要: interface Route { path?: string pathMatch?: string matcher?: UrlMatcher component?: Type<any> redirectTo?: string outlet?: string canActivate?: any[] 阅读全文
posted @ 2020-06-02 11:03 秦笑 阅读(248) 评论(0) 推荐(0)
摘要: 参考 http://www.ruanyifeng.com/blog/2015/05/async.html https://segmentfault.com/a/1190000007535316 await 只能出现在 async 函数中 async 函数返回的是一个 Promise 对象。 asyn 阅读全文
posted @ 2020-06-02 10:48 秦笑 阅读(174) 评论(0) 推荐(0)
摘要: /*这些是JavaScript导入语句。angular对此一无所知。*/ import { BrowserModule } from '@angular/platform-browser'; import { NgModule } from '@angular/core'; import { Fra 阅读全文
posted @ 2020-06-02 10:43 秦笑 阅读(168) 评论(0) 推荐(0)
摘要: 服务是 Angular 应用的重要组成部分。在 Angular 中,服务是一个类的实例,它可以借助 Angular 的依赖注入系统来让应用中的任何一个部件都能使用它。 新建服务 import { Injectable } from '@angular/core'; @Injectable({ pro 阅读全文
posted @ 2020-06-02 10:42 秦笑 阅读(320) 评论(0) 推荐(0)