我试图在我的角2应用程序中使用NG2-数据采集器。我遵循了上面的说明,但是日期选择器没有出现.控制台记录以下错误。
url_resolver.js:248 Uncaught TypeError: uri.match is not a function我的app.module.ts
import { DatePicker } from 'ng2-datepicker/ng2-datepicker';
@NgModule({
declarations: [
AppComponent,
DatePicker
],app.component.html
<datepicker [(ngModel)]="date" [expanded]="true"></datepicker>角版2.0.0
package.json
"dependencies": {
"@angular/common": "2.0.0",
"@angular/compiler": "2.0.0",
"@angular/core": "2.0.0",
"@angular/forms": "2.0.0",
"@angular/http": "2.0.0",
"@angular/platform-browser": "2.0.0",
"@angular/platform-browser-dynamic": "2.0.0",
"@angular/router": "3.0.0",
"@material2-extra/calendar": "0.0.14-1",
"core-js": "^2.4.1",
"moment": "^2.15.1",
"ng2-datepicker": "^1.1.0",
"rxjs": "5.0.0-beta.12",
"ts-helpers": "^1.1.1",
"zone.js": "^0.6.23"
},有什么建议吗?
谢谢
发布于 2016-10-07 06:12:44
发布于 2016-10-07 06:41:05
这是一个持续的问题,因为角2.0.0,如果您使用webpack和包(在您的例子中ng2-datepicker)有一个组件,使用module.id,您将得到这个错误。根据本期的说法,它是在2.0.1中修正的,但我还没有机会确认这一点。希望移动到那个版本将为您修复它。
如果不是的话,我已经在我的两个软件包上出现了问题,必须将html和css内联移动以支持webpack用户。您可以与包的发行者联系,看看他们是否会使用该解决方案。
https://stackoverflow.com/questions/39910310
复制相似问题