iron-meteor / iron-router

A client and server side router designed specifically for Meteor.
MIT License
1.98k stars 413 forks source link

Router.map() deprecated - How to replace it? #1503

Closed devdudeio closed 8 years ago

devdudeio commented 8 years ago

Hi

my router.js looks like:

Router.map(function () {
    this.route('a',{options: asdf});
    this.route('b',{options: asdf});
    this.route('c',{options: asdf});
    this.route('d, {options: asdf});
});

(offtopic: no clue whats wrong with my markdown here)

it looks like the map() function is deprecated. what is the new name of map() ? Or how I have to replace it?

chrisbutler commented 8 years ago

the new way is to define them separately, i.e.

Router.route('/', function () {
  this.render('Home');
});

Router.route('/one', function () {
  this.render('PageOne');
});

Router.route('/two', function () {
  this.render('PageTwo');
});