flatiron-director / core-pages SPA with route specific js functions & default route

后端 未结 1 1512

i am working with flatiron-director and core-pages. my question is how would i set a default route? also how do i call js functions on specific routes.

my code looks som

相关标签:
1条回答
  • 2021-01-23 14:56

    This app sets a default route and should demonstrate what you want: http://polymer-change.appspot.com/demos/spa.html.

    I believe the relevant code would be:

    var template = document.querySelector('template');
    
    template.addEventListener('template-bound', function() {
      this.route = this.route || 1; // default route to "1".
    });
    
    0 讨论(0)
提交回复
热议问题