Hi,
I'm new to angular and i wonder how i can do this :
- i created an app called "profile"
- i have a view and a controller
i create the app like this :
var myApp = angular.module('Profile', ['ui','autoComplete']);
myApp.value('profileConfig',{
type : '3', enableTerms : true
});
now i want to be able to use the same app on differents places in the same page with different configuration
for exemple
var myApp = angular.module('Profile', ['ui','autoComplete']);
myApp.value('profileConfig',{
type : '3', enableTerms : true
});
and
var MyOtherApp = angular.module('DifferentProfile', ['ui','autoComplete']);
myApp.value('profileConfig',{
type : '1', enableTerms : false
});
function ProfileController ($scope,$http,profileConfig) {
.....
}
in my page i have this :
<div ng-app="Profile">
<div ng-controller="ProfileController">
.....
</div>
</div>
<div ng-app="
DifferentProfile">
<div ng-controller="ProfileController">
.....
</div>
</div>
as you can see both apps share the same controller but have different configuration using " appanme.value() "
My first app in the page works great but not the second one .
So i think i use angular the wrong way to achieve this, could you please help me and explain the right way to do this ?
Many thanks