When I try to call one controller method from another controller in the angular Java script, But here occur error. I think something is missing there. If anyone has the complete method for to do this, give answer me.
Post edited by TechnoBear to remove signature
Some code would help - so we can see what it is you are trying to do and what might be stopping it from working.
Thank you, But I got Solution for that ,
Without seeing the problem in context it’s difficult to say for sure, but that’s almost certainly not a good idea. If you’ve got logic that needs to be shared between controllers, I’d put it into a service which can be injected into the controllers that need it.
One possibility would be to have controller A broadcast an event down the root scope, and controller B listen to that event to call the desired method. But as @fretburner says, it’s probably better to have that method in a service in the first place.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.