大佬教程收集整理的这篇文章主要介绍了angularjs跨路径维护范围变量,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
以下是使用的代码
/* Controllers */ var profileControllers = angular.module('profileControllers',['profileservices']) profileControllers.controller('profileListCtrl',['$scope','$LOCATIOn','Profile','$http',function($scope,$LOCATIOn,Profile,$http) { $scope.Profiles = Profile.query(function(){ if($scope.Profiles.length < 3) { $('#load_more_main_page').hide(); } }); $scope.orderProp = 'popular'; $scope.response=[]; //LOADMORE $scope.loadmore=function() { $http.get('profiles/profiles.PHP?profile_index='+$('#item-list .sub-item').length).success(function(responsE){ if(responsE) { var reponSELEngth = response.length; if(reponSELEngth > 1) { $.each(response,function(index,item) { $scope.Profiles.push({ UID: response[index].UID,id: response[index].id,popular: response[index].popular,imageUrl: response[index].imageUrl,name: response[index].name,tags: response[index].tags,category: response[index].category }); }); } if(reponSELEngth < 3) { $('#load_more_main_page').hide(); } } }); } }]); /* App Module */ var profileApp = angular.module('profileApp',[ 'ngRoute','profileControllers','profileservices',]); profileApp.config(['$routeProvider',function($routeProvider) { $routeProvider. when('/profiles',{ templateUrl: 'partials/profile-list.html',controller: 'profileListCtrl',resolve: { deps: function ($q,$rootScopE) { var deferred = $q.defer(); var dependencies = ['js/sort.js']; $script(dependencies,function () { $rootScope.$apply(function () { deferred.resolve(); }); }); return deferred.promise; } } }). when('/profiles/:profilEID',{ templateUrl: 'partials/profile-detail.html',controller: 'profileDetailCtrl',}). when('/profiles/cat/:category',{ templateUrl: 'partials/profile-list-category.html',controller: 'profileCategoryListCtrl',}). when('/create/',{ templateUrl: 'partials/profile-create.html',controller: 'profileCreateCtrl',css: ['css/createprofile.css','css/jquery-ui-1.10.4.custom.min.css','css/spectrum.css'],}). otherwise({ redirectTo: '/profiles' }); }]);
以上是大佬教程为你收集整理的angularjs跨路径维护范围变量全部内容,希望文章能够帮你解决angularjs跨路径维护范围变量所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。