Code Example for Guides -> Router -> Handling Authorization section appears to be incorrect
Opened this issue · 1 comments
Deleted user commented
I was working on the example code to get Authorization for the Router to work and was getting an error. I had to modify the line NetflixRouter.prototype = Object.create(BaseRouter) to NetflixRouter.prototype = Object.create(BaseRouter.prototype)
Example code with modification
var routes = [
// routes will go here
];
var BaseRouter = Router.createClass([routes]);
// Creating a constructor for a class that derives from BaseRouter
var NetflixRouter = function(userId){
// Invoking the base class constructor
BaseRouter.call(this);
this.userId = userId;
};
// The following line is modified
NetflixRouter.prototype = Object.create(BaseRouter.prototype)