I have this code in my angular app. So as the code says, there are multiple views being loaded and I want to pass one parameter.
.state('root.moduleListing', {
params: ['registerData'],
views: {
"main_container": {
controller: 'ModuleListingController as model',
templateUrl: 'misc/module-listing/module-listing.tpl.html',
resolve: {
registerData: ['$stateParams', function($stateParams) {
return $stateParams.registerData;
}]
}
},
"components_header_header": {
controller: 'HeaderController as model',
templateUrl: 'components/header/post-login.tpl.html',
},
"components_footer_footer": {
controller: 'FooterController as model',
templateUrl: 'components/footer/footer.tpl.html',
}
}
}
& I am calling it using
$state.go('root.moduleListing', {'registerdata': response});
& in controller, I am just trying to log it to the console.
module.controller('ModuleListingController', function ($scope, $state, registerData) {
var model = this;
console.log("registerData : " + registerData);
}
Now the app doesn't even start i.e. I get an error in the console saying:
failed to instantiate module amcatUI due to:
TypeError: id.match is not a function
at getArrayMode