Angular 2 error:

后端 未结 2 462
野趣味
野趣味 2021-01-22 20:02

Playing around with Angular 2 and trying to get this simple code working. yet I keep getting an error of:

EXCEPTION: Cannot resolve all parameters for Ta

2条回答
  •  心在旅途
    2021-01-22 20:07

    You have two solutions: Inject your Tabs class globally at bootstrap:

    bootstrap(MainCmp, [ROUTER_PROVIDERS, Tabs]);
    

    On inject Tabs locally with a binding property,

    @Component({
        selector: 'tab',
        bindings: [Tabs],   // injected here
        template: `
        
    • [...]

提交回复
热议问题