JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="myapp">
<div ng-controller="MyController">
{{ token }}
</div>
</div>
JavaScript
var mod = angular.module('myapp', []);
mod.service('token', [accessToken]);
function accessToken() {
this.accessToken = 'sdfsdf';
this.get = function() {
return this.accessToken;
};
this.set = function(token) {
this.accessToken = token;
};
}
mod.controller('MyController', ['token', myController]);
function myController(token) {
this.token = token.accessToken;
}