By this I mean I have read that Angular allows mock up data to be used so that RESTFul apis need not be wired up. I can think of a use case where a UX designer need only look a
So, the way I've done this is to create a temp service and just load that instead of from a url/file.
Example:
//tempUser.js
angular.module("app").constant("tempUser", {
firstname : "Joe",
lastname : "Smith"
});
//userService.js
angular.module("app").factory("userService", function ($q, tempUser) {
return {
load : load
};
function load(id) {
//TODO: finish impl
return $q.when(tempUser);
}
});
This way the controller can still work as if you were loading from a web service.
angular.module("app").controller("UserDetailCtrl", function (userService) {
userService.load().then(function (user) {
$scope.user = user;
});
});