求解,如題目描述,想給一個組件傳遞數(shù)據(jù),但這個組件在<route-outlet></route-outlet>的位置顯示 并不能直接在routeroutlet標簽上添加[XX] = "XX",看文檔好像可以通過 @conponent注解的host字段綁定class和attr, 但當我綁定[輸入值]的時候就會報錯,@Component({ selector: 'app-onlinecourse', templateUrl: './onlinecourse.component.html', host:{ class:"test", '[test]':"test" }...... @Input() test;..... ngOnChanges() { console.log(this.test); }//undifind報錯信息:Can't bind to 'test' since it isn't a known property of 'app-onlinecourse'.請輸入代碼謝謝
angular2如何給<route-outlet></route-outlet>占位之后需要路由到的
收到一只叮咚
2018-12-26 19:11:35