Last active
December 20, 2015 16:28
-
-
Save torufurukawa/6161212 to your computer and use it in GitHub Desktop.
angularjs service creation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('feiz', [], function($provide) { | |
$provide.factory('get', ['$http', function(http) { | |
return function(scope) { | |
http({url:'http://oldriver.org/index.html', method:'GET'}). | |
error(function(){ | |
scope.hoge = "azuma"; | |
}); | |
}; | |
}]); | |
}); | |
var FeizController = function($scope, get) { | |
get($scope); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment