Hi all,
I am trying to get OnsenUI set up in my new Angular2 project using the latest beta of Angular-CLI which uses Webpack. There was an earlier post about Angular-CLI here, but that is about an older version of the Angular-CLI that still uses SystemJS.
The error I get when I load the page is “ons is not defined”. I have tried adding
window.ons = require('onsenui');
and
window['ons'] = require('onsenui/js/onsenui.js');
in multiple files (app/index.ts, app/main.ts, ./main.ts) but to no avail.
Can someone point me in the right direction? I think it would be good if there is documentation on how to set up OnsenUI using Angular-CLI since that is definitely the easiest way to get an Angular2 project up and running at the moment.