Navigation

    Monaca & Onsen UI
    • Register
    • Login
    • Search
    • Tags
    • Users
    • Blog
    • Playground
    1. Home
    2. ypniag
    Y
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    ypniag

    @ypniag

    2
    Reputation
    3
    Posts
    943
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    ypniag Follow

    Posts made by ypniag

    • RE: [Angular2] "ons is not defined" using latest Angular-CLI

      I figured it out. I needed these entries in my angular-cli.json:

            "styles": [
              "../node_modules/onsenui/css/onsen-css-components.css",
              "../node_modules/onsenui/css/onsenui.css"
            ],
            "scripts": [
              "../node_modules/onsenui/js/onsenui.js"
            ],
      
      posted in Developer Corner
      Y
      ypniag
    • [Angular2] "ons is not defined" using latest Angular-CLI

      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.

      posted in Developer Corner
      Y
      ypniag
    • [Onsen UI 2 | Angular 2] ons-navigator - how to pass events or values back to previous page?

      Hi guys,

      Using the navigator I want to navigate to a new page, select a value and return the selected value to the original page. Both pages are separate components in separate files. I know it’s possible to supply a data value in the ‘options’ when calling popPage, but how would the original page know that there is a new value? Is there a callback or event when the page is re-opened or when a new page.data value is set? Or is there perhaps an even better way to achieve this?

      Thanks.

      posted in Onsen UI
      Y
      ypniag