With the lastest version of Require, a new config object was introduced, the shim.
http://requirejs.org/docs/api.html#config-shim
That allows Amplify to now be used within AMD projects.
Have Fun!
| public class IndexedRepo | |
| { | |
| private IClient _client; | |
| private static bool _indexCreated; | |
| private static readonly object _locker = new object(); | |
| public IndexedRepo(IClient client) | |
| { | |
| this._client = client; | |
| lock(_locker) |
| container.Register<IndexedCompanyRepository>(c => new IndexedCompanyRepository(new RiakCompanyRepository(container.Resolve<IRiakClient>()), | |
| container.Resolve<IElasticClient>())).ReusedWithin(ReuseScope.Request); | |
| container.Register<ICompanyRepository>(c => container.Resolve<IndexedCompanyRepository>()); | |
| container.Register<IFindCompanies>(c => container.Resolve<IndexedCompanyRepository>()); |
With the lastest version of Require, a new config object was introduced, the shim.
http://requirejs.org/docs/api.html#config-shim
That allows Amplify to now be used within AMD projects.
Have Fun!
| mod = angular.module('myApp.services', ['ngResource']); | |
| mod.factory('UserData', ($resource,$location) -> | |
| return $resource('http://' + $location.host() + '/Services/userinfo') | |
| ) | |
| .factory('UserDataStore', ($resource, $location, UserData, $q, $rootScope) -> | |
| GetUserDataFromXhr = () -> | |
| deferred = $q.defer() | |
| UserData.get((userdata) -> | |
| deferred.resolve userdata.userInfo |
| mod = angular.module('vendorPortal.services', ['ngResource']); | |
| mod.factory('UserData', ($resource,$location) -> | |
| resource = $resource('http://' + $location.host() + '/Services/userinfo') | |
| return () -> | |
| resource.get() | |
| ) | |
| .factory('UserDataStore', ($resource, $location, UserData, $q, $rootScope) -> | |
| mystore = new Lawnchair('userdata', () -> {}) | |
| GetUserDataFromXhr = () -> | |
| xhrDeferred = $q.defer() |
| /** | |
| * @license Angular Auth | |
| * (c) 2012 Witold Szczerba | |
| * License: MIT | |
| */ | |
| angular.module('angular-auth', []) | |
| /** | |
| * Holds all the requests which failed due to 401 response, | |
| * so they can be re-requested in the future, once login is completed. |
| var mod = {}; | |
| mod.AuthCtrl = [ | |
| '$scope', 'requests401', '$http', 'Ping', '$location', function($scope, requests401, $http, Ping, $location) { | |
| var fadespeed = 300; | |
| $scope.user = { | |
| "username": "test", | |
| "password": "test" | |
| }; |