小编Rob*_*dia的帖子

Angular 2在Bootstrap之前解析服务

http://plnkr.co/edit/yhQQZxTxB8ZVFysqO6lP?p=preview

在AppComponent加载之前,如何确保我的AuthService得到解决?

//main entry point
import {bootstrap} from '@angular/platform-browser-dynamic';
import {Http,HTTP_PROVIDERS} from '@angular/http';
import {App} from './app';
import {AuthService} from './auth.service';
import {provide, enableProdMode, APP_INITIALIZER} from '@angular/core';

bootstrap(App, [HTTP_PROVIDERS,
provide("isLoggedIn", { useFactory: (auth:AuthService) => () => auth.login(), deps:[HTTP_PROVIDERS], multi: true }),
])
  .catch(err => console.error(err));
Run Code Online (Sandbox Code Playgroud)

angular

5
推荐指数
1
解决办法
1271
查看次数

Angular 2 Web Pack 404 Html模板URL

我正在使用Angular2 RC4版本和webpack dev服务器.我无法成功加载我的应用程序.在浏览器控制台上,它会抛出404并且无法使用webpack加载AppComponent模板文件.如果我使用lite-server,这是有效的

app.component.ts片段

@Component({
    moduleId:module.id,
    selector: 'body',
    templateUrl: 'app.component.html',
})
Run Code Online (Sandbox Code Playgroud)

webpack.config.js片段

 module:{
       loaders:[
            {test:/\.ts$/, loader:'ts',   exclude: /node_modules/},
            {test:/\.html$/, loader:'html' },
       ],

    },
Run Code Online (Sandbox Code Playgroud)

错误 browser_adapter.js?0526:84 错误:未捕获(在承诺中):无法加载/app.component.html

webpack-dev-server angular

4
推荐指数
1
解决办法
4433
查看次数

Angular 2 RC4新路由器警告消息

我在控制台上看到此警告消息.我正在使用新的angular 2路由器.我错过了什么或者我必须做些什么来修复这个警告?

'DashboardComponent' not found in precompile array.
To ensure all components referred to by the RouterConfig are compiled, you must add 'DashboardComponent' to the 'precompile' array of your application component.
This will be required in a future release of the router.
Run Code Online (Sandbox Code Playgroud)

router angular

2
推荐指数
1
解决办法
1402
查看次数

Angular 6循环依赖

我在Angular 6应用中遇到以下错误。其实已经很久了,我正在尝试将旧的Angular 4应用程序升级到Angular 6。

WARNING in Circular dependency detected:
src/app/resources/index.ts -> 
src/app/resources/models/filters/sowSearch.model.ts -> 
src/app/shared/services/index.ts -> 
src/app/shared/services/rest/http.interceptor.ts -> 
src/app/resources/index.ts
Run Code Online (Sandbox Code Playgroud)

请告知问题或需要更多信息。

angular

1
推荐指数
1
解决办法
3694
查看次数

标签 统计

angular ×4

router ×1

webpack-dev-server ×1