Skip to content

Instantly share code, notes, and snippets.

View klaascuvelier's full-sized avatar

Klaas Cuvelier klaascuvelier

View GitHub Profile
@ProLoser
ProLoser / AngularJS-Cachebusting.js
Last active September 10, 2020 12:54
Elegant cache-busting for AngularJS HTML assets
anglar.module('myApp',['ui']).config(["$provide", function($provide) {
return $provide.decorator("$http", ["$delegate", function($delegate) {
var get = $delegate.get;
$delegate.get = function(url, config) {
// Check is to avoid breaking AngularUI ui-bootstrap-tpls.js: "template/accordion/accordion-group.html"
if (!~url.indexOf('template/')) {
// Append ?v=[cacheBustVersion] to url
url += (url.indexOf("?") === -1 ? "?" : "&");
url += "v=" + cacheBustVersion;
}
@furf
furf / 0-angular-tree.js
Last active July 21, 2016 06:36
A minimal recursive tree directive for Angular.js. Demo: http://jsfiddle.net/furf/EJGHX/
var app = angular.module('app', []);
app.directive('yaTree', function () {
return {
restrict: 'A',
transclude: 'element',
priority: 1000,
terminal: true,
compile: function (tElement, tAttrs, transclude) {