Skip to content

Instantly share code, notes, and snippets.

@Xanir
Xanir / noBind
Last active August 29, 2015 14:01
no-bind directive
(function(angular, $) {
var module = angular.module('net.enzey.bindonce', []);
var ctrlBind = function($parse) {
return function($scope) {
$scope.$watch = function(varExpression, func) {
// varExpression.exp is passed as the 'old' value
// so that angular can remove the expression text from an
// element's attributes, such as when using an expression for the class.