0
我正在使用版本1.0.2
的angular-2-dropdown-multiselect。錯誤:(SystemJS)無法解析MultiselectDropdown的所有參數:(?,?)
在HTML
<ss-multiselect-dropdown [options]="users" [texts]="userDropdownTexts" [settings]="userDropdownSettings" [(ngModel)]="selectedUsers"
name="selectedUsers" required></ss-multiselect-dropdown>
控制器
import語句
import { IMultiSelectOption, IMultiSelectSettings, IMultiSelectTexts } from 'angular-2-dropdown-multiselect';
組件類
export class MyComponent implements OnInit {
userDropdownSettings: IMultiSelectSettings;
userDropdownTexts: IMultiSelectTexts;
// object for multi-select drop down
private users: Array<any> = [];
selectedUsers: number[];
ngOnInit() {
this.userDropdownSettings = {
pullRight: false,
enableSearch: true,
checkedStyle: 'checkboxes',
buttonClasses: 'btn btn-default',
selectionLimit: 0,
closeOnSelect: false,
showCheckAll: false,
showUncheckAll: false,
dynamicTitleMaxItems: 4,
maxHeight: '170px',
};
this.userDropdownTexts = {
checkAll: 'Check all',
uncheckAll: 'Uncheck all',
checked: 'checked',
checkedPlural: 'checked',
searchPlaceholder: 'Search...',
defaultTitle: 'Select Users',
};
}
一切工作正常。我從1.0.2
這個庫更新到1.0.3
現在這正顯示出
Error: (SystemJS) Can't resolve all parameters for MultiselectDropdown: (?, ?).
Error: Can't resolve all parameters for MultiselectDropdown: (?, ?).
at SyntaxError.BaseError [as constructor] (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:1595:29) [<root>]
at new SyntaxError (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:1793:18) [<root>]
at CompileMetadataResolver._getDependenciesMetadata (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:18458:33) [<root>]
at CompileMetadataResolver._getTypeMetadata (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:18333:28) [<root>]
at CompileMetadataResolver.getNonNormalizedDirectiveMetadata (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:17973:26) [<root>]
at CompileMetadataResolver._loadDirectiveMetadata (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:17849:25) [<root>]
at eval (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:18050:56) [<root>]
at Array.forEach (native) [<root>]
at CompileMetadataResolver.loadNgModuleDirectiveAndPipeMetadata (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:18049:43) [<root>]
at eval (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:27290:60) [<root>]
at Array.forEach (native) [<root>]
at JitCompiler._loadModules (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:27289:45) [<root>]
at JitCompiler._compileModuleAndComponents (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:27244:54) [<root>]
at JitCompiler.compileModuleAsync (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:27210:23) [<root>]
Evaluating http://localhost:3000/app/index.js
Error loading http://localhost:3000/app/index.js
at SyntaxError.BaseError [as constructor] (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:1595:29) [<root>]
at new SyntaxError (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:1793:18) [<root>]
at CompileMetadataResolver._getDependenciesMetadata (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:18458:33) [<root>]
at CompileMetadataResolver._getTypeMetadata (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:18333:28) [<root>]
at CompileMetadataResolver.getNonNormalizedDirectiveMetadata (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:17973:26) [<root>]
at CompileMetadataResolver._loadDirectiveMetadata (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:17849:25) [<root>]
at eval (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:18050:56) [<root>]
at Array.forEach (native) [<root>]
at CompileMetadataResolver.loadNgModuleDirectiveAndPipeMetadata (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:18049:43) [<root>]
at eval (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:27290:60) [<root>]
at Array.forEach (native) [<root>]
at JitCompiler._loadModules (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:27289:45) [<root>]
at JitCompiler._compileModuleAndComponents (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:27244:54) [<root>]
at JitCompiler.compileModuleAsync (http://localhost:3000/node_modules/@angular/compiler/bundles/compiler.umd.js:27210:23) [<root>]
Evaluating http://localhost:3000/app/index.js
Error loading http://localhost:3000/app/index.js
可能是什麼問題?
我認爲,我們需要看到一些代碼,允許重現封閉GitHub的問題。 –
您是否已將multiselect模塊添加到您正在使用它的模塊的'imports:[...]? –
是的!!我已經添加了。這在1.0.2版本中工作正常。 –