angularjs mobile v1.0
This commit is contained in:
@ -9,7 +9,7 @@ angular.module('myApp', [
|
||||
'ngRoute',
|
||||
'ngAnimate',
|
||||
'myApp.controllers',
|
||||
'myApp.memoryServices'
|
||||
'myApp.services'
|
||||
]).
|
||||
config(['$routeProvider', '$interpolateProvider', function ($routeProvider, $interpolateProvider) {
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
|
@ -1,19 +0,0 @@
|
||||
'use strict';
|
||||
|
||||
// service 用来共享数据
|
||||
angular.module('myApp.restServices', ['ngResource'])
|
||||
.factory('Employee', ['$resource',
|
||||
function ($resource) {
|
||||
var r = $resource('http://localhost:3000/employees/:employeeId', {});
|
||||
log("r >>>");
|
||||
log(r);
|
||||
log("r <<<");
|
||||
return r;
|
||||
}])
|
||||
|
||||
.factory('Report', ['$resource',
|
||||
function ($resource) {
|
||||
return $resource('http://localhost:3000/employees/:employeeId/reports', {});
|
||||
}]);
|
||||
|
||||
|
@ -1,27 +1,7 @@
|
||||
|
||||
angular.module('myApp.memoryServices', [])
|
||||
.factory('Employee', [
|
||||
function () {
|
||||
return {
|
||||
query: function () {
|
||||
return employees;
|
||||
},
|
||||
get: function (employee) {
|
||||
return findById(parseInt(employee.employeeId));
|
||||
}
|
||||
}
|
||||
|
||||
}])
|
||||
.factory('Report', [
|
||||
function () {
|
||||
return {
|
||||
query: function (employee) {
|
||||
return findByManager(parseInt(employee.employeeId));
|
||||
}
|
||||
}
|
||||
|
||||
}])
|
||||
// services
|
||||
|
||||
angular.module('myApp.services', [])
|
||||
// Note
|
||||
.factory('Note', ["$http", function($http) {
|
||||
var self = this;
|
Reference in New Issue
Block a user