Sunday 6 January 2019

angularjs - Angular ui-router : Passing params between states

I'm trying to pass a message from state1 to state2 in ui-router.



looked up most of the question on here about this topic but unfortunately can't make sense of it.



This is my main code and $stateProvider :



myApp.config(function($stateProvider, $urlRouterProvider) {
//
// For any unmatched url, redirect to /state1
$urlRouterProvider.otherwise("/state1");
//
// Now set up the states
$stateProvider
.state('state1', {
url: "/state1",
templateUrl: "state1.html"
})
.state('state2', {
url: "/state2",
templateUrl: "state2.html"
})

});


Here is a Plunker of what i created to test this out.



What should i do to make it work? Thanks

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...