I was hoping after a user logs in I could load a controller for the logged in view in Angular UI Router as simply as this:
"content@":{
templateProvider: function($http, $stateParams) {
return $http({
method: 'GET',
url: '/homeV'
}).then(function successCallback(html) {
return html.data;
});
},
controllerProvider: function($http, $stateParams) {
return $http({
method: 'GET',
url: '/homeC'
}).then(function successCallback(html) {
return html.data;
});
}
}
But controllers are not templates, and it doesn't appear to work as easily as I had hoped. There are a lot of questions here about similar concerns, but I don't want to have to use Require.js if I don't have to.
Is Require.js the only option? If so I will experiment with that, but I wanted to make sure I'm not missing something first.