observer){observer.next(1);observer.next(2);observer.next(3);observer.complete();}); Observable严格遵守自身的规约
使用自定义路由规则,您可以将任何URI映射到任何控制器和方法,并打破常规约定:http://example.com/[controller-class]/[controller-method]/[arguments
第一个API是“重定向(redirect)”规约: e2e-tests/scenarios.ts content_copyit('shouldredirect`index.html`to`index.html
(Lua库中的常规约定是使用字符串而不是数字来选择选项。)
类令牌关联的服务注入进来: src/app/heroes/hero-list.component.ts content_copyconstructor(heroService:HeroService) 这是一个特殊的规约
测试文件的扩展名必须是.spec.ts,这样工具才能识别出它是一个测试文件,也叫规约(spec)文件。
遵循规约,添加一个AppRoutingModule类并导出它,以便稍后在AppModule中导入它。 最后,可以通过把它添加到该模块的exports数组中来再次导出RouterModule。