Navigation

    Monaca & Onsen UI
    • Login
    • Search
    • Tags
    • Users
    • Blog
    • Playground
    1. Home
    2. kkng_88
    3. Posts
    K
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by kkng_88

    • RE: carousel.setActiveCarouselItemIndex(index) not working in OnsenUI 2.0 with Angular 1

      Thanks Fran, that certainly did work…
      However, the documentation does not seem to be updated in anyway to reflect that.

      posted in Onsen UI
      K
      kkng_88
    • carousel.setActiveCarouselItemIndex(index) not working in OnsenUI 2.0 with Angular 1

      I’ve spent a few days trying to figure out what is wrong via documentation - this should work easily out of the box but seems that something more fundamental is causing the issue…

      How to recreate the issue

      1. Created a new project from the templates on Monaca - Onsen UI 2.0 with Angular 1.
      2. Loaded the OnsenUI 2.0 theme and Monaca JQuery latest version from CSS/JS components
      3. Created a carousel and a button to change the carousel index
      4. Carousel does not change when button is clicked.
      5. When button is clicked, console log shows that setActiveCarouselItemIndex is not a function
      6. However, carousel.next() works fine

      Here’s my code:

      <ons-page>
          <ons-button ng-click="carousel.setActiveCarouselItemIndex(2)">Push Carousel</ons-button>
          <ons-carousel style="height:100%;width:100%;" var="carousel" swipeable overscrollable auto-scroll>
              <ons-carousel-item>Page 1 </ons-carousel-item>
              <ons-carousel-item>Page 2 </ons-carousel-item>
              <ons-carousel-item>Page 3</ons-carousel-item>
          </ons-carousel>
      </ons-page>
      
      posted in Onsen UI
      K
      kkng_88