Skip to content

Tips for using navstack with Ractive #8

@ahallora

Description

@ahallora

I was having issues with combining multiple Ractive-views with navstack and the documentation was rather limited on the matter. The active pane kept overwriting the previous panes. However, I finally figured it out myself. cue applause 😃

Here's my test setup:

   stage = new Navstack({
      el: $('#stack'),
      transition: 'slide',
      groupTransition: 'modal',
      adapt: ['ractive'] // defining support for ractive
    });

    stage.push('#home', function() {      
      return new Ractive({
        el: '#stack',
        template: 'Hi {{name}}',
        data: { name: 'Anders' },
        append: true // this did the trick ! 
      });      
    });

And you can then get the Ractive instance by doing this:

    var name = stage.panes["#home"].view.get('name');

...or change the data with Ractive:

    stage.panes["#home"].view.set('name', 'Rstacruz');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions