Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

mlardy/angular-hal

Open more actions menu
 
 

Repository files navigation

angular-hal

Build Status

Help wanted!

If you feel like helping out, plese contact me!

use it in your project!

Easy installation using bower

bower install angular-hal

then, reference the js files in your html page

<script src="bower_components/rfc6570/rfc6570.js"></script>
<script src="bower_components/angular-hal/angular-hal.js"></script>

You may use it like this:

angular
.module('app', ['angular-hal'])
.run([
	'$rootScope'
	, '$window'
	, 'halClient'
	, function(
		$rootScope
		, $window
		, halClient
	) {
		var token = $window.sessionStorage.getItem('token');

		$rootScope.apiRoot = halClient.$get('https://api.example.com/', {
			authorization: token && 'Bearer ' + token + ''
		});

		$rootScope.$watch('apiRoot', function(apiRoot){
			$rootScope.authenticatedUser = apiRoot.$get('http://example.com/authenticated-user');
		});

	}
])//run

stay tuned for more!

check this out!

compatibility

If you wish to use this service in old (ie) browsers, you may need to use the following polyfills:

About

HAL client for angularjs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 95.3%
  • HTML 3.9%
  • CSS 0.8%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.