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
| createRoute = (name,controller) -> | |
| template = "views/#{name}" | |
| controller = controller or "#{name.charAt(0).toUpperCase()}Ctrl" | |
| route = | |
| name: name | |
| url: "/#{name}" | |
| views: | |
| content: | |
| templateUrl: template | |
| controller: controller |
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
| auth = | |
| name: "auth" | |
| url: "/auth" | |
| abstract: true | |
| # this isn't using the templateCache | |
| # templateUrl: "views/auth_layout.html" | |
| templateProvider: ($templateCache,$log) => | |
| $templateCache.get('views/auth.layout.html') |
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
| 'use strict' | |
| class WebService | |
| constructor: (@$http) -> | |
| login: (user) -> | |
| @$http.post("http://localhost:3000/login", user) | |
| getData: () -> |
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
| /*global localStorage*/ | |
| /** | |
| * The Cacher Module with the service CacheLocal | |
| */ | |
| angular.module('Cacher', []). | |
| factory('CacheLocal', function($cacheFactory) { | |
| var cache = $cacheFactory('someCache', {}); | |
| var PREFIX = 'Cacher::'; |
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
| Services.factory("LawnchairFactory", function($window, $log, $parse) { | |
| return function(name, config) { | |
| var collection = {}; | |
| var array = []; | |
| var isArray = config && config.isArray; | |
| var idGetter = $parse((config && config.entryKey) ? config.entryKey : "id"); | |
| var transformSave = (config && config.transformSave) ? config.transformSave : angular.identity; | |
| var transformLoad = (config && config.transformLoad) ? config.transformLoad : angular.identity; | |
| function getEntryId(entry){ |
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
| ExampleController = ($scope, LocationService) -> | |
| LocationService.locate().then (position) -> | |
| $scope.position = position | |
| ExampleController.$inject = ["$scope", "LocationService"] | |
| YourAngularApp.controller("ExampleController", ExampleController) |
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
| # dependency - Function.prototype.bind or underscore/lodash | |
| app = angular.module 'someApp' | |
| class @BaseCtrl | |
| @register: (app, name) -> | |
| name ?= @name || @toString().match(/function\s*(.*?)\(/)?[1] | |
| app.controller name, @ | |
| @inject: (args...) -> |
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
| injector = angular.element(document.body).injector() |
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
| class SecurityService | |
| @$inject:['$http','sessionService', 'api'] | |
| constructor:(@http, @session, @api) -> | |
| login:(username, password) => | |
| @http.get "#{@api.base}/security/login/credentials/#{username}/#{password}" | |
| .success (user)=> | |
| @session.isAuthenticated = true | |
| @session.user = user | |
| .error (ex)=> |
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
| git remote | grep -q frbit-stage || git remote add frbit-stage git@git1.eu1.frbit.com:my-app-stage.git | |
| git push frbit-master refs/heads/stage:refs/heads/master |