Ionic route-Pass value

Source: Internet
Author: User

Ionic route-Pass value 

App.js

=====================================

New Work task
. State (' App.newtask ', Angularamd.route ({
URL: '/newtask?:userid:username:img:isclear:arr1:arr2:arr3′,
Cache: ' False ',
Views: {
' Menucontent ': {
Templateurl: ' app/templates/oa/newtask.html ',
Controller: ' Newtaskctrl '
}
},
Templateurl: ' app/templates/oa/newtask.html ',
Controller: ' Newtaskctrl ',
Before routing, perform the following
Resolve: {
Loadcontroller: [' $q ', ' $ocLazyLoad ',
function ($q, $ocLazyLoad)
{
Get the Controller name = = = Here as a path to Controller_name.js
Which is set in Main.js path {}
JS loading to Requirejs management. The ionic framework is bound to the route and cannot be oclazyload to load the page.
ANGULARAMD: Its role is to combine Angularjs and Requirejs.
REQUIREJS+ANGULARAMD can integrate the ionic framework, so load on demand is REQUESTJS.
Since the file cannot be loaded except JS, $ocLazyLoad to load the other.
var load1 = "App/controllers/oa/newtaskcontroller.js";
var deferred = $q. Defer ();
Require ([Load1], function () {
Load css,requirejs,html and so on.
$ocLazyLoad. Load (
[
{
Name: ' CSS ',
InsertBefore: ' #xxx ',
Files: [
' Lib/angular-lazy-image/lazy-image-style.css ',
' App/controllers/discuss/dsmaincontroller.js '
]
}
]
);
Deferred.resolve ();
});
return deferred.promise;
}]
}
}))

============================

Selectpersoncontroller.js

Responsible for completing the jump
$scope. Gopage = function (Target,param) {$state. Go (target,{userid: $scope. Isselect,username: $rootScope. username,img:$ ROOTSCOPE.IMG});
}

=================================

Newtask.html

<a class= "button Button-icon button-clear ion-android-add" style= "Font-size:24px;color: #00A000;" Menu-close ng-click= "Gopage (' App.newtask ',") "></a>

Ionic route-Pass value

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.