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 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
find . -name \.AppleDouble -exec rm -rf {} \; |
This file contains 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
var parseUrl = (function() { | |
var parser = document.createElement('a'); | |
return function(url) { | |
parser.href = url; | |
return { | |
hash: parser.hash, | |
host: parser.host, | |
hostname: parser.hostname, |
This file contains 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
// Documented by Stoyan Stefanov: https://www.facebook.com/note.php?note_id=10151176218703920 | |
(function() { | |
var url = 'http://example.org/js.js'; | |
var iframe = document.createElement('iframe'); | |
(iframe.frameElement || iframe).style.cssText = | |
"width: 0; height: 0; border: 0"; | |
iframe.src = "javascript:false"; | |
var where = document.getElementsByTagName('script')[0]; | |
where.parentNode.insertBefore(iframe, where); | |
var doc = iframe.contentWindow.document; |
This file contains 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
var app = angular.module('myApp', []); | |
/* Set up a simple controller with a few | |
* examples of common actions a controller function | |
* might set up on a $scope. */ | |
app.controller('MainCtrl', function($scope, someService) { | |
//set some properties | |
$scope.foo = 'foo'; | |
$scope.bar = 'bar'; |