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
/* | |
Source http://stackoverflow.com/a/7310398 | |
http://jsfiddle.net/kizu/4RPFa/74/ | |
*/ | |
.frame { | |
height: 25px; /* equals max image height */ | |
width: 160px; | |
border: 1px solid red; |
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
//Credit http://stackoverflow.com/a/5767357 | |
var array = [2, 5, 9]; | |
var index = array.indexOf(5); | |
if (index > -1) { | |
array.splice(index, 1); | |
} |
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
<input type="checkbox" ng-model="strict"><br> | |
<table id="searchObjResults"> | |
<tr><th>Name</th><th>Phone</th></tr> | |
<tr ng-repeat="friendObj in friends | filter:search:strict"> | |
<td>{{friendObj.name}}</td> | |
<td>{{friendObj.phone}}</td> | |
</tr> | |
</table> |
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('moduleName') | |
.directive('myDirective', function () { | |
return { | |
restrict: 'EA', //E = element, A = attribute, C = class, M = comment | |
scope: { | |
//@ reads the attribute string value, | |
//= provides two-way binding, | |
//& works with functions | |
title: '@' | |
}, |
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('directivesModule') | |
.directive('isolateScopeWithController',function(){ | |
return { | |
restrict:'EA', | |
scope: {datasource:'=',add:'&'}, | |
controller: function($scope){ | |
function init() { | |
$scope.customers=angular.copy($scope.datasource); | |
} | |
init(); |
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 id="task-users" class="panel panel-default" ng-include="'/Angular-App/projektweb3/task-details/partial-templates/users.tpl.html'"></div> | |
<html ng-app> | |
<!-- Body tag augmented with ngController directive --> | |
<body ng-controller="MyController"> | |
<input ng-model="foo" value="bar"> | |
<!-- Button tag with ng-click directive, and string expression 'buttonText' wrapped in "{{ }}" markup --> | |
<button ng-click="changeFoo()">{{buttonText}}</button> | |
<script src="angular.js"> | |
</body> | |
</html> |
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
//For an rfc4122 version 4 compliant solution, this one-liner(ish) solution is the most compact I could come up with | |
//http://stackoverflow.com/a/2117523 | |
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); | |
return v.toString(16); | |
}); | |
//http://guid.us/GUID/JavaScript | |
function S4() { | |
return (((1+Math.random())*0x10000)|0).toString(16).substring(1); |
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
//Source http://blog.hugeaim.com/2013/04/07/clearing-a-form-with-angularjs/ | |
//make the record pristine | |
$scope.commentForm.$setPristine(); | |
$scope.comment = {..}; |
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
https://htmlagilitypack.codeplex.com/discussions/24346 | |
http://eksith.wordpress.com/2011/06/14/whitelist-santize-htmlagilitypack/ | |
Web Protection | |
http://www.troyhunt.com/2010/05/owasp-top-10-for-net-developers-part-2.html | |
http://www.asp.net/web-api/overview/security/enabling-cross-origin-requests-in-web-api |
OlderNewer