mirror of
https://github.com/arnaucube/commonroutesAdminWeb.git
synced 2026-02-07 03:06:44 +01:00
added search (users and travels), added user network, added all travels visualization
This commit is contained in:
@@ -2,34 +2,35 @@
|
||||
|
||||
angular.module('app.main', ['ngRoute'])
|
||||
|
||||
.config(['$routeProvider', function($routeProvider) {
|
||||
$routeProvider.when('/main', {
|
||||
templateUrl: 'views/main/main.html',
|
||||
controller: 'MainCtrl'
|
||||
});
|
||||
}])
|
||||
|
||||
.controller('MainCtrl', function($scope, $http) {
|
||||
$scope.users = [];
|
||||
$scope.loadMorePagination = true;
|
||||
$scope.page = 0;
|
||||
|
||||
$http.get(urlapi + 'users?page=' + $scope.page)
|
||||
.then(function(data) {
|
||||
console.log('data success');
|
||||
console.log(data);
|
||||
$scope.users=data.data;
|
||||
|
||||
}, function(data) {
|
||||
console.log('data error');
|
||||
});
|
||||
$http.get(urlapi + 'travels?page=' + $scope.page)
|
||||
.then(function(data) {
|
||||
console.log('data success');
|
||||
console.log(data);
|
||||
$scope.travels=data.data;
|
||||
|
||||
}, function(data) {
|
||||
console.log('data error');
|
||||
.config(['$routeProvider', function($routeProvider) {
|
||||
$routeProvider.when('/main', {
|
||||
templateUrl: 'views/main/main.html',
|
||||
controller: 'MainCtrl'
|
||||
});
|
||||
});
|
||||
}])
|
||||
|
||||
.controller('MainCtrl', function($scope, $http) {
|
||||
$scope.users = [];
|
||||
$scope.travels = [];
|
||||
$scope.loadMorePagination = true;
|
||||
$scope.page = 0;
|
||||
|
||||
$http.get(urlapi + 'users?page=' + $scope.page)
|
||||
.then(function(data) {
|
||||
console.log('data success');
|
||||
console.log(data);
|
||||
$scope.users = data.data;
|
||||
|
||||
}, function(data) {
|
||||
console.log('data error');
|
||||
});
|
||||
$http.get(urlapi + 'travels?page=' + $scope.page)
|
||||
.then(function(data) {
|
||||
console.log('data success');
|
||||
console.log(data);
|
||||
$scope.travels = data.data;
|
||||
|
||||
}, function(data) {
|
||||
console.log('data error');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user