2

我正在关注角度 2 的 Onsen UI 2 指南:https ://onsen.io/v2/docs/guide/angular2/index.html#loading-onsen-ui-in-angular-2 。但我不知道我应该把这段代码放在哪里:

 window['ons'] = require('onsenui/js/onsenui');
 import { ONS_DIRECTIVES, OnsNavigator } from 'angular2-onsenui';

我试过把它放在我的 app.component.ts 和 app.module.ts 中。但是我的浏览器控制台向我抛出了一个错误:

ReferenceError: Ons is not defined
4

0 回答 0