小编Him*_*pta的帖子

错误:找不到加载'ProfileDetailsComponent'的主要插座

我正在尝试在我的应用程序中使用路由,使用路由器版本3.0.0-beta.1,应用程序正在运行,但是当我点击subjects.component.html中的"下一步"按钮时,我期待获取'的内容' profileDetails.component.html".我创造了一个plunkr例如.这里:http://plnkr.co/edit/jR3jnC6CzmRVCoVFrn1W?p=preview它不适用于plunkr虽然由于我正在使用的角度2素材按钮等我猜,但有谁能告诉我我要去哪里错误?这是我的主要内容:

import {bootstrap} from '@angular/platform-browser-dynamic';
import {enableProdMode} from '@angular/core';
import {AppComponent} from './app/app.component';
import {HTTP_PROVIDERS} from '@angular/http';
import { appRouterProviders } from './app/app.routes';

//import {disableDeprecatedForms, provideForms} from '@angular/forms';

bootstrap(AppComponent, [
  // disableDeprecatedForms(),
  // provideForms(),
  HTTP_PROVIDERS,
  appRouterProviders
]);
Run Code Online (Sandbox Code Playgroud)

这是app.routes.ts:

import { provideRouter, RouterConfig } from '@angular/router';
import {SubjectsComponent} from './subjects.component';
import {ProfileDetailsComponent} from './profileDetails.component';
import {AgreementComponent} from './agreement.component';

export const routes: RouterConfig = [
  { path: 'card', component: BasicCardComponent },
  { path: 'subjects', component: SubjectsComponent },
  { path: …
Run Code Online (Sandbox Code Playgroud)

angular2-routing angular

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

ngSwitchCase在角度2而不是ngSwitchWhen

我正在使用ngSwitchWhen现在我想使用ngSwitchCase,我在这里提到了语法https://angular.io/docs/ts/latest/api/common/index/NgSwitch-directive.html并在我的应用程序中做了同样的事情.没有任何错误,但它也没有正常工作.不知何故,上述链接中提供的用于提供示例的plunker使用ngSwitchWhen.这是我的sub.component.ts:

@Component({
    selector: 'subjects',
    templateUrl: 'app/subjects.component.html' ,
    styleUrls: ['app/app.component.css'],
    directives:[MdButton,MdCard,MdToolbar,MdIcon,MdInput,MD_INPUT_DIRECTIVES,MdCheckbox,ProfileDetailsComponent,ROUTER_DIRECTIVES],
     providers:[MdIconRegistry]
})

export class SubjectsComponent{
    viewMode='first';
    view='one';
    stateNext: boolean = false;

  private buttonState: boolean = true;

  private classes1 = [{label: 'English', state: false},{label:  'Hindi', state: false},{label:  'Mathematics', state: false},{label:  'Science', state: false},{label:  'Computer Science', state: false},{label:  'Social science', state: false},{label:  'Environmental Studies', state: false}];
  private classes6 = [{label: 'English', state: false},{label:  'Hindi', state: false},{label:  'Mathematics', state: false}];
  private classes9 = [{label: 'English', state: false},{label:  'Hindi', state: false},{label:  'Mathematics', …
Run Code Online (Sandbox Code Playgroud)

ng-switch angular

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

标签 统计

angular ×2

angular2-routing ×1

ng-switch ×1