From 7e6f9992216157a10a64a86fe526f61f9f57e43f Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Fri, 12 Nov 2010 15:16:33 -0800 Subject: added remaining directives and search box. --- src/markups.js | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'src/markups.js') diff --git a/src/markups.js b/src/markups.js index 159d7b12..57a209b7 100644 --- a/src/markups.js +++ b/src/markups.js @@ -68,6 +68,57 @@ angularTextMarkup('OPTION', function(text, textNode, parentElement){ } }); +/** + * @ngdoc directive + * @name angular.directive.ng:href + * + * @description + * Using markup like {{hash}} in an href attribute makes + * the page open to a wrong URL, ff the user clicks that link before + * angular has a chance to replace the {{hash}} with actual URL, the + * link will be broken and will most likely return a 404 error. + * The `ng:href` solves this problem by placing the `href` in the + * `ng:` namespace. + * + * The buggy way to write it: + *
+ * 
+ * 
+ * + * The correct way to write it: + *
+ * 
+ * 
+ * + * @element ANY + * @param {template} template any string which can contain `{{}}` markup. + */ + +/** + * @ngdoc directive + * @name angular.directive.ng:src + * + * @description + * Using markup like `{{hash}}` in a `src` attribute doesn't + * work right: The browser will fetch from the URL with the literal + * text `{{hash}}` until replaces the expression inside + * `{{hash}}`. The `ng:src` attribute solves this problem by placing + * the `src` attribute in the `ng:` namespace. + * + * The buggy way to write it: + *
+ * 
+ * 
+ * + * The correct way to write it: + *
+ * 
+ * 
+ * + * @element ANY + * @param {template} template any string which can contain `{{}}` markup. + */ + var NG_BIND_ATTR = 'ng:bind-attr'; var SPECIAL_ATTRS = {'ng:src': 'src', 'ng:href': 'href'}; angularAttrMarkup('{{}}', function(value, name, element){ -- cgit v1.2.3