Closure Scope not captured? — Coffeescript

This loop: for item in data.contents itemBox = $ “<div/>”, class: “itembox” is somewhat deceptive if you’re not used to (Coffee|Java)Script scope. The scoping actually looks more like this: itemBox = undefined for item in data.contents itemBox = $ “<div/>”, class: “itembox” so there is only one itemBox variable and that same variable gets used … Read more

Angularjs, passing scope between routes

You need to use a service since a service will persist throughout your app’s life. Lets say you want to save data pertaining to a user This is how you define the service : app.factory(“user”,function(){ return {}; }); In your first controller: app.controller( “RegistrationPage1Controller”,function($scope,user){ $scope.user = user; // and then set values on the object … Read more