angularjs – IntelliJ和Angular 2参数类型不可分配的错误
发布时间:2020-12-17 10:23:12 所属栏目:安全 来源:网络整理
导读:IntelliJ中的Angular2(v15的最新更新 – 终极版)应该有效吗?所有的文档似乎都说它是通过AngularJS插件完成的,但我得到的是奇怪的智能感知错误.例如; bootstrap(App,[ ROUTER_PROVIDERS,provide(LocationStrategy,{useClass: HashLocationStrategy})]); 引发
IntelliJ中的Angular2(v15的最新更新 – 终极版)应该有效吗?所有的文档似乎都说它是通过AngularJS插件完成的,但我得到的是奇怪的智能感知错误.例如;
bootstrap(App,[ ROUTER_PROVIDERS,provide(LocationStrategy,{useClass: HashLocationStrategy}) ]); 引发参数类型App不能分配给参数类型Type 和标准注释一样; @RouteConfig([ {path: '/...',component: RootView,as: 'RootView',useAsDefault: true} ]) throw参数类型{path:string,component:RootView,as:string,useAsDefault:boolean} []不能赋值给参数类型RouteDefinition [] 以前有人碰过这个吗?有谁知道如何让smartJ玩得好听? 按要求提供应用程序来源; import {Component,ViewEncapsulation} from 'angular2/core'; import {RootView} from './root-view'; import { RouteConfig,ROUTER_DIRECTIVES } from 'angular2/router'; @Component({ selector: 'app',templateUrl: './components/app/app.html',encapsulation: ViewEncapsulation.None,directives: [ROUTER_DIRECTIVES] }) @RouteConfig([ {path: '/...',useAsDefault: true} ]) export class App { }
事实证明,由于我无法解释的原因,需要构造函数或IntelliJ真的很混乱,并且混淆一直沿着依赖链.
在我的实例中,修复很简单,是App中的默认空构造函数: export class App { constructor() {} } 但是Angular2中使用IntelliJ的一般经验法则似乎是DI链中所有内容的构造函数 – 至少目前是这样.我认为这是一个错误,将在IntelliJ的角度插件中修复 – 我只是将它提交给他们. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |