Angular $state.go jump page and pass parameters

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Encounter a page jump, the page after the jump to get the data before the jump page, I think of a localstorage, a kind of broadcast and on, then the boss said not so troublesome, since all $state.go directly with parameters, this time to introduce the $ State.go page Jump pass parameters.
1. Routing page (note here to add a parameter to the route to pass the data, otherwise it will filter when the page jumps)
. State ("Home.workpiece", {//Pre-jump page

  url:"/workpiece",  views: {    home: {      templateUrl: prefix + "project/workpiece.html",      controller: "workpieceCtrl"    }  }}).state("home.workpieceDetail",{   //跳转后的页面  url:"/workpieceDetail?workpieceList",  views: {    home: {      templateUrl: prefix + "project/workpiece_detail.html",      controller: "workpieceDetailCtrl"    }  }})也可以将参数放在params中.state("home.workpieceDetail",{  url:"/workpieceDetail",  views: {    home: {      templateUrl: prefix + "project/workpiece_detail.html",      controller: "workpieceDetailCtrl"    }  },  params: {workpieceList:null}})

2. In the Workpiecectrl


In 3.workpieceDetailCtrl


This will allow you to pass the data when the page jumps.

Finally, this link introduces four ways of page jump pass parameters: Http://www.cnblogs.com/Razor0 ...

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.