Skip to main content

Posts

Showing posts from March 18, 2017

Injecting one controller into another controller in AngularJs

We can use functionality of one controller into another controller Here for injecting one controller into another one we have to use $controller service it will instantiate a controller inside another controller Syntax: app.controller('Cntrl1',  function () {     this.MethodTest = function () {       // functionality     } }); app.controller('Cntrl2', ['$scope', '$controller', function ($scope, $controller) {      var testCtrl= $controller('Cntrl1');      testCtrll.MethodTest(); }]);

Contact Form

Name

Email *

Message *