GitXplorerGitXplorer
h

elpong-angularjs

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
9767722735077ea7037f76d933b9dd4455a3e468

Update README with api url and preloading comment

hhansottowirtz committed 8 years ago
Unverified
126f716cffa557e77ab3d00875fb536e05e50e5d

Update README for Elpong

hhansottowirtz committed 8 years ago
Unverified
00f69a9fa47c0683d00fd6773a8a55e575d53de7

Update README again

hhansottowirtz committed 9 years ago
Unverified
df56ee75299c82bbc7b2af236de51fc37d5c6ce1

Update README mistake

hhansottowirtz committed 9 years ago
Unverified
b6db01b9ca9c67c8ebc2dbee43f50bdec5844a24

Update README

hhansottowirtz committed 9 years ago
Unverified
eb057822e612524b7ed21a4a9aee807dd53a9c17

Initial commit

hhansottowirtz committed 9 years ago

README

The README file for this repository.

Elpong for AngularJS

There is no need for a separate angularjs module, as support for $http is built-in.

Add this to your code:

app.config([function(){
  Elpong.enableAutoload(); // when using preloading
}]);
app.run(['$http', function($http){
  Elpong.setAjax($http);
}]);

Make sure your preloaded meta tags come before the script that loads angularjs.

Then just use Elpong in your controller, or create a factory that returns your scheme.

app.factory('Elpong', ['$window', function($window){
  return $window.Elpong;
}]);
app.factory('Scheme', ['Elpong', function(Elpong){
  var scheme = Elpong.get('animal-farm');
  scheme.setApiUrl('/api');
  return scheme;
}]);