Skip to content

Instantly share code, notes, and snippets.

View PatrickKennedy's full-sized avatar

Patrick Kennedy PatrickKennedy

View GitHub Profile
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active January 1, 2026 01:15
Conventional Commits Cheatsheet
@rvillars
rvillars / README.md
Last active March 22, 2016 12:31
Preprocess directive attributes in AngularJS

Preprocess directive attributes in AngularJS

Sometimes you need to modify a two way binded attribute value prior to use it in the directive. This can't be done in the directive controller, because the attribute assignment is done after the controller is executed.

The link function is able to access the attributes directly but unfortunately a two way binded attribute expression isn't yet evaluated a that time.

The solution is to process the attribute in a scope.$watch function where the value will be evaluated automatically.

http://jsfiddle.net/gh/gist/angularjs/1.2.1/d60d9416f2206c6e3407/