hi so far i had tried below code
HTML
<div ng-controller="mycontroller"> <button ng-click ="clickme()">
demoooooo</button> {{message}}</div>
<div ng-controller="hellocontroller">{{message}}</div>
in my js
app.factory("datafactory",function("dataFactory"){
var mouse={}
mouse.dosum=function(){
return "my world";
}
});
app.controller(" mycontroller",function(){
$scope.clickme=function(){
$scope.message=datafactory.dosum()
}});
app.controller(" mycontroller",function(){
$scope.message=datafactory.dosum()
});
and my question is that after clicking the button only the data should render in both the controllers thank you! can anyone explain me clearly how come i can achieve it . In my second controller the data appears before hitting the button