Controller:
app.controller('activitiesViewController', ['$scope', 'ActivitiesFactory',
'$location',
function($scope, ActivitiesFactory, $location) {
function init () {
$scope.activities = ActivitiesFactory.getAllWithCounts();
}
init();
$scope.loadDateController = function(id, count) {
$location.path = '/activities/showdates/' + id;
};
}]);
Routes:
app.config(['$routeProvider', function($routeProvider){
$routeProvider
.when('/activities/showdates/:id', {
templateUrl : 'views/datesView.html',
controller : 'datesViewController'
})
.otherwise({
redirectTo: '/'
});
}]);
The function "loadDateController" is executed by a button ng_click in the
html. The debugger show that the statement "$location.path =
'/activities/showdates/' + id;" is being executed.
When the button is clicked, nothing happens. I looked a many examples on
the web and most of them show that this works. Obviously, I am doing
something that is wrong.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.