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
//In your Gruntfile | |
grunt.registerTask('replaceURL', '...', require('./urlReplacer.js')); | |
//Then in urlReplacer.js | |
var fs, r, oldfile, newfile; | |
fs = require('fs'); | |
r = new RegExp("some regex to match your url", 'g'); | |
//read the the file and replace the text | |
oldfile = fs.readFileSync(__dirname + '/file-with-url-that-needs-to-be-replaced.js', 'utf8'); | |
newfile = oldfile.replace(r, 'http://thenewurl.com'); |
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
<div ng-controller="TestCtrl" > | |
<div test-ctrl-move-handler="doMouseMoveEvent()" style="width:1000px;height:1000px;"></div> | |
</div> |
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
angular.module('app').directive('MyDirective', function(){ | |
//NEW AND IMPROVED, NOW WITH LESS WATCHING! | |
return { | |
restrict: 'AE', | |
replace: 'true', | |
templateUrl: '../../blah.html', | |
scope:{ | |
item: '=' | |
}, |
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
.item{ | |
background-color:white; | |
color:black; | |
} | |
.item:hover{ | |
background-color:black; | |
color:white; | |
} |
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
<div class="big-section"> | |
<div ng-if="archiveMode"> | |
<div class="header"> | |
<i class="archive-icon"></i> | |
</div> | |
<div> | |
<span>{{description}}</span> | |
</div> | |
<button ng-click="unarchive()">Unarchive</button> | |
</div> |
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
<!--Parent Controller--> | |
<div ng-controller="ParentController"> | |
<!--First Child Controller--> | |
<div ng-controller="ChildAController"> | |
<button ng-click="handleClick()">Click This</button> | |
</div> | |
<!--Second Child Controller--> | |
<div ng-controller="ChildBController"> | |
<button ng-click="handleClick()">Click This</button> |
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
<!--Parent Controller--> | |
<div ng-controller="ParentController"> | |
<!--First Child Controller--> | |
<div ng-controller="ChildAController"> | |
<button ng-click="handleClick()">Click This</button> | |
</div> | |
<!--Second Child Controller--> | |
<div ng-controller="ChildBController"> | |
<button ng-click="handleClick()">Click This</button> |
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
angular.module('app').run(function($q, $timeout){ | |
function User(data){ | |
if(this == window)return new User(data); | |
angular.extend(this, data); | |
} | |
User.prototype.sayHi = function(){ | |
console.log("HI!!!"); |
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 a; | |
console.log(a); //Logs 'undefined' | |
console.log(b); //ReferenceError: 'b' is not defined | |
/** | |
* Neither are defined, but only the undeclared variable gets an 'undefined' error. | |
* | |
* So, is the correct idiom 'undeclared' when referring to an instruction that will throw | |
* a ReferenceError because it wasn`t declared? Or is there another idiom that I should use? | |
* |
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
let a = 0; | |
{ | |
console.log(a); //Node throws error cause "a" isn`t defined yet, but it was defined on line one. | |
let a = 1; | |
console.log(a); | |
} | |
console.log(a); |
OlderNewer