2017-06-13 155 views
0

我有我的pollyfills,並從main.bundle.js中的Internet Explorer中收到此錯誤。它在9692線上,但看着編譯後的代碼,我無法理解它。這是:Angular 2/4:在嚴格模式下不允許多個屬性的定義

styles: ["\nng-select-custom >>> .caret {\n /* display: none; */\n}\nng-select-custom >>> .ui-select-match-text {\n white-space: normal;\n line-height: 21px;\n}\nng-select-custom >>> .ui-select-toggle {\n overflow: hidden;\n}\n"] 

這是Angular 2/4的常見問題嗎?我沒有看到這方面有任何的帖子與NG2/4

更新:這是有問題的代碼更背景:

DropdownRuleInputComponent = __decorate([ 
    __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__angular_core__["Component"])({ 
     selector: 'dropdown-rule-input', 
     template: "\n <ng-select-custom\n [class.invalid]=\"invalidShowing\"\n [items]=\"items\"\n [active]=\"activeSelection\"\n (selected)=\"selection = $event\"\n placeholder=\"Click for options\">\n </ng-select-custom>\n ", 
     styles: [__webpack_require__("../../../../../../pushgraph-client/lib/search/rule-inputs/default-styles.sass")], 
     styles: ["\nng-select-custom >>> .caret {\n /* display: none; */\n}\nng-select-custom >>> .ui-select-match-text {\n white-space: normal;\n line-height: 21px;\n}\nng-select-custom >>> .ui-select-toggle {\n overflow: hidden;\n}\n"] 
    }), 
    __metadata("design:paramtypes", [typeof (_d = typeof __WEBPACK_IMPORTED_MODULE_3__shared_search_service__["a" /* SearchService */] !== "undefined" && __WEBPACK_IMPORTED_MODULE_3__shared_search_service__["a" /* SearchService */]) === "function" && _d || Object]) 
], DropdownRuleInputComponent); 

回答

0

我相信它抱怨這個ng-select-custom >>>。我的語法改爲host: >>>。不太確定缺少host變量導致此問題。

+0

我完全不熟悉這個語法,或者如何修改Webpack/Angular-CLI的輸出。 – BBaysinger

+0

這兩個鏈接解釋了這一點。 https://stackoverflow.com/questions/32853924/angular-2-how-to-style-host-element-of-the-component https://alligator.io/angular/styles-between-components-angular/可以你也讓我們更多的代碼而不僅僅是一行,所以我們可以理解它。 –

+0

我已更新該問題。感謝您一直以來的幫助。 – BBaysinger

相關問題