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