| Provider | Singleton | Instantiable | Configurable |
|---|---|---|---|
| Constant | Yes | No | No |
| Value | Yes | No | No |
| Service | Yes | No | No |
| Factory | Yes | Yes | No |
| Decorator | Yes | No? | No |
| Provider | Yes | Yes | Yes |
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
| //* | |
| //* See the JS Fiddle: http://jsfiddle.net/sxcjmoj5/3/ | |
| //* | |
| //* | |
| // make sure ngSanitize module is installed: | |
| // https://docs.angularjs.org/api/ngSanitize | |
| // | |
| // To convert links from plaintext, you must use the linky filter which is included with ngSanitize | |
| // https://docs.angularjs.org/api/ngSanitize/filter/linky | |
| // |
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
| import org.apache.logging.log4j.LogManager; | |
| import org.apache.logging.log4j.Logger; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.beans.factory.annotation.Value; | |
| import org.springframework.http.client.SimpleClientHttpRequestFactory; | |
| import org.springframework.stereotype.Component; | |
| import org.springframework.web.client.RestTemplate; | |
| import javax.annotation.PostConstruct; |
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
| app.filter('capitalize', function() { | |
| return function(input, scope) { | |
| if (input!=null) | |
| input = input.toLowerCase(); | |
| return input.substring(0,1).toUpperCase()+input.substring(1); | |
| } | |
| }); |
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
| /*! | |
| * $rootScope listeners, remember to unbind on $destroy | |
| */ | |
| var $rootListeners = { | |
| 'transmitProgress': $rootScope.$on('transmit:progress', transmitProgress), | |
| 'transmitSuccess': $rootScope.$on('transmit:success', transmitSuccess), | |
| 'transmitError': $rootScope.$on('transmit:error', transmitError) | |
| }; | |
| // iterate the Object and pass the methods to be called on $destroy |
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
| describe( "Mock examples:", function() { | |
| var version = jasmine.version_ ? jasmine.version_.major : parseInt( jasmine.version, 10 ); | |
| var spyName = function( spy ) { | |
| if( version === 1 ) { | |
| return spy.identity; | |
| } else { | |
| return spy.and.identity() | |
| } |
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('stateMock',[]); | |
| angular.module('stateMock').service("$state", function($q){ | |
| this.expectedTransitions = []; | |
| this.transitionTo = function(stateName){ | |
| if(this.expectedTransitions.length > 0){ | |
| var expectedState = this.expectedTransitions.shift(); | |
| if(expectedState !== stateName){ | |
| throw Error("Expected transition to state: " + expectedState + " but transitioned to " + stateName ); | |
| } | |
| }else{ |
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
| #/usr/bin/env bash | |
| # MIT © Sindre Sorhus - sindresorhus.com | |
| # forked by Gianluca Guarini | |
| changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
| check_run() { | |
| echo "$changed_files" | grep -E --quiet "$1" && eval "$2" | |
| } |
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
| #!/usr/bin/env bash | |
| # MIT © Sindre Sorhus - sindresorhus.com | |
| # git hook to run a command after `git pull` if a specified file was changed | |
| # Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
| changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
| check_run() { | |
| echo "$changed_files" | grep --quiet "$1" && eval "$2" |

