angular2-modal:“拒绝访问属性拒绝的权限”

时间:2017-01-17 05:14:32

标签: javascript angular

在我的amgular2seedadvanced app中使用angular2-modal时出错了

错误:拒绝访问属性“拒绝”的权限

我之前曾经问过这个问题,但在我的情况下,我无法解决这个问题。我正在关注this

的package.json

"angular2-modal": "^2.0.2"

系统config.js

'angular2-modal': 'node_modules/angular2-modal/bundles/angular2-modal.umd.js',
  'angular2-modal/plugins/bootstrap': 'node_modules/angular2-modal/bundles/angular2-modal.bootstrap.umd.js'
packages: {
 'angular2-modal': {
    main: './index',
    defaultExtension: 'js'
  },
  'angular2-modal/plugins/bootstrap': {
    main: 'index.js',
    defaultExtension: 'js'
  }
}

component.ts

import { Modal } from 'angular2-modal/plugins/bootstrap';

@BaseComponent({
moduleId: module.id,
selector: 'demo-list',
templateUrl: './list.component.html',
styleUrls: ['list.component.css']
})
export class ListComponent {

constructor(public modal: Modal) {}

addUser() {
        this.modal.alert()
        .title('Hello World')
        .body('In Angular 2')
        .open();
    }    
};

list.component.html

<div>
    <h4>Users
    <button type="button" style="float: right;" (click)="addUser()">Add</button>
    </h4>
    <md-card>
        Basic card.
    </md-card>
</div>
单击添加按钮模式时,

将不会显示此错误。我该如何解决这个问题?

0 个答案:

没有答案