0

I want to pass the data from one controller1 to another controller2 both of the controller are related to two different functionalities. In controler1 data is loading when I hit the different functionality I want that data in controller2 which is related to different functionality

app.service("knowledgebaseService",function($rootScope){
    this.TempData = "";
    this.SetData = function(d){
        this.TempData = d;
        $rootScope.$emit("knowledgebaseevent")``
    }
    this.GetData = function (){
        return this.TempData;
    }
})   

I want the data to be loaded in html file

georgeawg
  • 48,608
  • 13
  • 72
  • 95
MadhuMsd
  • 7
  • 4
  • Possible duplicate of https://stackoverflow.com/questions/45222348/angularjs-how-to-pass-data-from-one-controller-to-another-on-ng-click – Gangadhar Jannu Aug 15 '19 at 13:04
  • Possible duplicate of [Passing data between controllers in Angular JS?](https://stackoverflow.com/questions/20181323/passing-data-between-controllers-in-angular-js) – Gangadhar Jannu Aug 15 '19 at 13:04

0 Answers0