小编Arp*_*wal的帖子

使用Rxjs umd包

我刚刚从角度QuickStart跳过2.0.0-rc2并更新了system-config.ts文件来下载rxjs的umd文件即 rxjs\bundles\Rx.umd.js

这很有效.但我仍然在开发工具中看到很多单独的JS正在加载rxjs\observer.js

我看到来自@angular的http.umd.js直接引用它 rxjs\bundles\Rx.umd.js

有没有办法只加载单个Rx.umd.js或我们必须使用非捆绑文件.

Ps:我的dist文件夹也有非捆绑的rxjs文件,因为我正处于切换到umd.js的中间,我将在稍后纠正.

rxjs angular

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

Angular2子路由不起作用

我正在使用@angular rc4 "@angular/router": "^3.0.0-beta.2"

我无法让子路由工作,当我开始添加子路由时,我会遇到很多种错误:这是我的路由代码:

{ path: '', redirectTo: 'parentComp'},
{ path: 'parentComp', component: parentContainer, 
        children: [
            {path: 'componenta', component: ComponentA }
        ]
    }
Run Code Online (Sandbox Code Playgroud)

EXCEPTION:在实例化路由器时出错!.BrowserDomAdapter.logError @ browser_adapter.js:84BrowserDomAdapter.logGroup @ browser_adapter.js:94ExceptionHandler.call @ exception_handler.js:65(匿名函数)@ application_ref.js:337schedulerFn @async.js:139SafeSubscriber .__ tryOrUnsub @ Subscriber.js:223SafeSubscriber.next @ Subscriber.js:172Subscriber._next @ Subscriber.js:125Subscriber.next @ Subscriber.js:89Subject.next @ Subject.js:55EventEmitter.emit @ async.js:127onError @ ng_zone .js:124onHandleError @ ng_zone_impl.js:74ZoneDelegate.handleError @ zone.js:327Zone.runTask @ zone.js:259ZoneTask.invoke @ zone.js:423 browser_adapter.js:84 ORIGINAL EXCEPTION:错误:路由的路由配置无效' {path:"",redirectTo:"activity"}':请提供'pathMatch'.'pathMatch'的默认值是'prefix',但通常意图使用'full'.BrowserDomAdapter.logError @ browser_adapter.js:84ExceptionHandler.call @ exception_handler.js:74(匿名函数)@ application_ref.js:337schedulerFn @ async.js:139SafeSubscriber .__ tryOrUnsub @ Subscriber.js:223SafeSubscriber.next @ Subscriber.js:172Subscriber._next @ Subscriber.js:125Subscriber.next @ Subscriber.js:89Subject.next @ …

typescript angular2-routing angular

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

RC5 NgModules声明

将角度2升级到RC5后,我收到如下警告,要求我将组件移动到模块声明:

NgModule AppModule通过"entryComponents"使用AcademylistComponent但它既未声明也未导入!最终结束后,此警告将成为错误.

我在路由器配置文件中引用了这些组件.看起来像这样:

import {provideRouter,RouterConfig} from '@angular/router';
import {AcademylistComponent} from '../modules/home/component/academyList.component';
import {CourselistComponent} from '../modules/home/component/courseList.component';
import {CreateacademyComponent} from '../modules/home/component/createAcademy.component';
import {ReportsComponent} from '../modules/home/component/reports.component';
import {AuthenticatedGuard} from '../guards/authenticated.guard';

export const routes: RouterConfig = [
{
    path: '',
    redirectTo:'/home',
    terminal:true},
{
    path: 'home',
    canActivate: [AuthenticatedGuard],
    children: [

        {path: '', component: AcademylistComponent},
        {path: 'my-academies', component: AcademylistComponent},
        {path: 'my-courses', component: CourselistComponent},
        {path: 'create-academy', component: CreateacademyComponent},
        {path: 'reports', component: ReportsComponent}

    ]

}

];

export const APP_ROUTER_PROVIDERS = [
provideRouter(routes)
];
Run Code Online (Sandbox Code Playgroud)

当我将组件移动到ng模块的declarations阵列并将其导入那里时,路由配置文件确实开始给我Cannot …

typescript angular

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

标签 统计

angular ×3

typescript ×2

angular2-routing ×1

rxjs ×1