Jump to content

Angularjs Question


Recommended Posts

Posted
angular.module('DemoApp').controller('ParentCtrl',function($scope){
$scope.Prt = {};
$scope.Prt.name = 'John';
}).controller('SonCtrl',function($scope){
$scope.son ={};
$scope.son.name='Sam';
});
 
 
 
 <div class="container" ng-app='DemoApp'>
    <div ng-controller="ParentCtrl">
        <h1>Hello, {{Prt.name}}</h1>
        <div>
            <h1>Hello {{Son.name}}, Son of {{Prt.name}}</h1>
        </div>
    </div>
</div>
</div>

 

Posted

without scopes use chedham anedi aa example

Posted

then i dont know. But angularjs is changing in 2.0 , do u know es6 script??

Posted
angular.module('DemoApp').controller('ParentCtrl',function($scope){
$scope.Prt = {};
$scope.Prt.name = 'John';
}).controller('SonCtrl',function($scope){
$scope.son ={};
$scope.son.name='Sam';

})

 

error ikada vundhi .. controller(-----).controller(---),,

 

assign controller to the app module .

 

 

Posted

Parent and son object properties are not filled, try to put break points and see if the controller is getting called.

Posted

remove this from your index file, it will work:  ng-controller='myController'

 

Posted

remove the controller at starter-template it worked for me in plunker.

 

screenshot attach cheyalekapothuna.... vedhava jivitham

 

 

 

can some tell what I am doing wrong here

http://plnkr.co/edit/mEftP9GYoSXbKlE6i5qU?p=info

 

i get this output

Hello, {{Prt.name}}
Hello {{Son.name}}, Son of {{Prt.name}}

 

 

Posted

remove the controller at starter-template it worked for me in plunker.

 

screenshot attach cheyalekapothuna.... vedhava jivitham

 

Posted

just kill me i say..i dont know y i had that there and dint see

thanks dude

remove the controller at starter-template it worked for me in plunker.

 

screenshot attach cheyalekapothuna.... vedhava jivitham

 

×
×
  • Create New...