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
| grails.config.locations = [ ] | |
| grails.config.locations << "file:$userHome/.grails/app-prod.groovy" |
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
| angular.module('http-loading-interceptor', ['spinner']) | |
| .config(['$httpProvider', 'spinnerProvider', ($httpProvider, spinnerProvider) -> | |
| interceptor = (data, headersGetter) -> | |
| spinnerProvider.startSpinner() | |
| data | |
| $httpProvider.defaults.transformRequest.push(interceptor) | |
| ]) | |
| .config(['$httpProvider', 'spinnerProvider', ($httpProvider, spinnerProvider) -> |
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
| angular.module('spinner', []) | |
| .provider('spinner', () -> | |
| @$get = () -> return null | |
| @startSpinner = () -> | |
| spinnerEl = $('<p id="spinner"></p>') | |
| data = spinnerEl.data() | |
| if (data.spinner) | |
| data.spinner.stop() |
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
| # Define new module | |
| angular.module('http-loading-interceptor') | |
| # Add filter at request send time | |
| .config(['$httpProvider', ($httpProvider) -> | |
| interceptor = (data, headersGetter) -> | |
| alert("loading...") | |
| data | |
| $httpProvider.defaults.transformRequest.push(interceptor) | |
| ]) |
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 sp.collections.DogCollection extends Backbone.Collection | |
| initialize: -> | |
| @fetch() | |
| setInterval(@fetchChanges, 15*1000) | |
| model: sp.models.DogModel | |
| url: '/dogs' |
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
| server = sinon.fakeServer.create() | |
| server.autoRespond=true | |
| server.respondWith("GET", /\/customer\/(\d+)/, (xhr, id) -> | |
| xhr.respond( 200, { "Content-Type": "application/json" }, JSON.stringify(window.sampleCustomerJson )) | |
| ) |
NewerOlder