(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| git fetch --all | |
| git reset --hard origin/master | |
| git pull origin master |
| use 'strict'; | |
| /** | |
| * workaround for: https://github.com/angular/angular.js/issues/1460 | |
| * source: http://victorblog.com/2014/01/12/fixing-autocomplete-autofill-on-angularjs-form-submit/ | |
| * decoration tips: http://angular-tips.com/blog/2013/09/experiment-decorating-directives/ | |
| * credits: https://github.com/evictor | |
| * | |
| * note: this directive only fixes the behaviour on form submit event, | |
| * it doesn't fix the bidirectional data binding |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
This gist is no longer in use.
| // Hyperscope | |
| // Upgrading $scope.$watch, making some new friends | |
| angular.module('hyperscope', []) | |
| // service for extending $scope objects | |
| .factory('Hyperscope', function($parse, $rootScope){ | |
| var vanillaAdditions = { |
| /** | |
| * the HTML5 autofocus property can be finicky when it comes to dynamically loaded | |
| * templates and such with AngularJS. Use this simple directive to | |
| * tame this beast once and for all. | |
| * | |
| * Usage: | |
| * <input type="text" autofocus> | |
| * | |
| * License: MIT | |
| */ |
| /** | |
| * VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units | |
| * | |
| * To overcome this, create media queries that target the width, height, and orientation of iOS devices. | |
| * It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing | |
| * the height of element `.foo` —which is a full width and height cover image. | |
| * | |
| * iOS Resolution Quick Reference: http://www.iosres.com/ | |
| */ | |
| !function(i,o){i("Keen","/3.1.0/keen.min.js",o)}(function(a,b,c){var d,e,f;c["_"+a]={},c[a]=function(b){c["_"+a].clients=c["_"+a].clients||{},c["_"+a].clients[b.projectId]=this,this._config=b},c[a].ready=function(b){c["_"+a].ready=c["_"+a].ready||[],c["_"+a].ready.push(b)},d=["addEvent","setGlobalProperties","trackExternalLink","on"];for(var g=0;g<d.length;g++){var h=d[g],i=function(a){return function(){return this["_"+a]=this["_"+a]||[],this["_"+a].push(arguments),this}};c[a].prototype[h]=i(h)}e=document.createElement("script"),e.async=!0,e.src=b,f=document.getElementsByTagName("script")[0],f.parentNode.insertBefore(e,f)},this); | |
| (function(i,o){i("Keen","/3.1.0/keen.min.js",o);}(function(t,h,x){ | |
| // t = context | |
| // h = file | |
| // x = context | |
| // console.log(t,h,x===window); | |
| var methods, script, tag; | |
| // _Keen cache |
| The MIT License (MIT) | |
| Copyright (c) 2014 Tomas Kafka | |
| Permission is hereby granted, free of charge, to any person obtaining a copy | |
| of this software and associated documentation files (the "Software"), to deal | |
| in the Software without restriction, including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| copies of the Software, and to permit persons to whom the Software is | |
| furnished to do so, subject to the following conditions: |
| module.exports = function(config) { | |
| config.set({ | |
| basePath: '', | |
| frameworks: ['jasmine'], | |
| files: [ | |
| // lib | |
| './app/lib/angular/angular.js', | |
| './app/lib/**/angular-*.js', | |