Skip to content

Instantly share code, notes, and snippets.

@noeticpenguin
Created December 2, 2013 23:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noeticpenguin/7761086 to your computer and use it in GitHub Desktop.
Save noeticpenguin/7761086 to your computer and use it in GitHub Desktop.
directive template
angular./**
* app Module
*
* skeleton app module for skeleton directive.
*/
var app = angular.module('app', [])
.directive('ng', ['', function(){
// Runs during compile
return {
name: 'modelAndBind',
// priority: 1,
// terminal: true,
// scope: {}, // {} = isolate, true = child, false/undefined = no change
cont­rol­ler: function($scope, $element, $attrs, $transclue) {
// here we need to determine if we've overridden the field and if so, return the input value
// which wil lbe $element.value()
// otherwise calculate the sum
},
require: 'ngModel', // Array = multiple requires, ? = optional, ^ = check parent elements
restrict: 'A', // E = Element, A = Attribute, C = Class, M = Comment
// template: '',
// templateUrl: '',
// replace: true,
// transclude: true,
// compile: function(tElement, tAttrs, function transclude(function(scope, cloneLinkingFn){ return function linking(scope, elm, attrs){}})),
link: function($scope, iElm, iAttrs, controller) {
}
};
}]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment