Hello all, thanks for any help you can provide in advance.
I am working on a web application which is using angular, however, it is
not a SPA (single page app). Which means I do not really do any
view-switching within angular. I am basically using angular purely for the
client side binding framework. I am running into an issue trying to get
angular to parse route parameters:
var app = angular.module('workspace', ['ngRoute']);
app.config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/workspace/admin/campaign/:campaignId/edit', { });
}]);
I am trying to inject the campaignId into my controller and us it in my
controller:
app.controller('campaignEditController', ['$scope', '$http','$routeParams',
function ($scope, $http, $routeParams) {
if(typeof $routeParams.campaignId === 'string' && $routeParams.
campaignId.length > 1) { // <--- Always Undefined
api_getCampaign($scope, $http, $routeParams.campaignId);
}
});
However, I am never getting any values in my routeParams object... I am
trying to avoid doing view switching on the page itself, but is that my
only real option?
Thanks!
Rob
--
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.