diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Injector.js | 2 | ||||
| -rw-r--r-- | src/Scope.js | 24 | ||||
| -rw-r--r-- | src/angular-mocks.js | 6 | ||||
| -rw-r--r-- | src/directives.js | 94 | ||||
| -rw-r--r-- | src/filters.js | 22 | ||||
| -rw-r--r-- | src/formatters.js | 15 | ||||
| -rw-r--r-- | src/jqLite.js | 52 | ||||
| -rw-r--r-- | src/markups.js | 49 | ||||
| -rw-r--r-- | src/validators.js | 21 | ||||
| -rw-r--r-- | src/widgets.js | 22 |
10 files changed, 208 insertions, 99 deletions
diff --git a/src/Injector.js b/src/Injector.js index 0f752dc4..77d25a77 100644 --- a/src/Injector.js +++ b/src/Injector.js @@ -5,7 +5,7 @@ * * @description * Creates an inject function that can be used for dependency injection. - * (See {@link guide/di dependency injection}) + * (See {@link guide/dev_guide.di dependency injection}) * * The inject function can be used for retrieving service instances or for calling any function * which has the $inject property so that the services can be automatically provided. Angular diff --git a/src/Scope.js b/src/Scope.js index c7bdda0e..bf582474 100644 --- a/src/Scope.js +++ b/src/Scope.js @@ -117,19 +117,19 @@ function errorHandlerFor(element, error) { * * Angular scope objects provide the following methods: * - * * {@link angular.Scope.$become $become()} - - * * {@link angular.Scope.$bind $bind()} - - * * {@link angular.Scope.$eval $eval()} - - * * {@link angular.Scope.$get $get()} - - * * {@link angular.Scope.$new $new()} - - * * {@link angular.Scope.$onEval $onEval()} - - * * {@link angular.Scope.$service $service()} - - * * {@link angular.Scope.$set $set()} - - * * {@link angular.Scope.$tryEval $tryEval()} - - * * {@link angular.Scope.$watch $watch()} - + * * {@link angular.scope.$become $become()} - + * * {@link angular.scope.$bind $bind()} - + * * {@link angular.scope.$eval $eval()} - + * * {@link angular.scope.$get $get()} - + * * {@link angular.scope.$new $new()} - + * * {@link angular.scope.$onEval $onEval()} - + * * {@link angular.scope.$service $service()} - + * * {@link angular.scope.$set $set()} - + * * {@link angular.scope.$tryEval $tryEval()} - + * * {@link angular.scope.$watch $watch()} - * - * For more information about how angular scope objects work,, see {@link guide/scopes Angular Scope - * Objects} in the angular Developer Guide. + * For more information about how angular scope objects work, see {@link guide/dev_guide.scopes + * Angular Scope Objects} in the angular Developer Guide. */ function createScope(parent, providers, instanceCache) { function Parent(){} diff --git a/src/angular-mocks.js b/src/angular-mocks.js index ba7f7461..5cf7ff7c 100644 --- a/src/angular-mocks.js +++ b/src/angular-mocks.js @@ -68,10 +68,10 @@ * * Built-in mocks: * - * * {@link angular.Mock.service.$browser $browser } - A mock implementation of the browser. - * * {@link angular.Mock.service.$exceptionHandler $exceptionHandler } - A mock implementation of the + * * {@link angular.mock.service.$browser $browser } - A mock implementation of the browser. + * * {@link angular.mock.service.$exceptionHandler $exceptionHandler } - A mock implementation of the * angular service exception handler. - * * {@link angular.Mock.service.$log $log } - A mock implementation of the angular service log. + * * {@link angular.mock.service.$log $log } - A mock implementation of the angular service log. */ angular.mock = {}; diff --git a/src/directives.js b/src/directives.js index 07c8fdc1..680e8a72 100644 --- a/src/directives.js +++ b/src/directives.js @@ -5,39 +5,41 @@ * @description * * Custom attributes for DOM elements. Directives modify the behavior of the element they are - * specified in, but are not intended to add elements to the DOM as are {@link widget widgets}. + * specified in, but are not intended to add elements to the DOM as are + * {@link angular.widget widgets}. * * Following is the list of built-in angular directives: * - * * {@link angular.Directive.ng:bind ng:bind} - Creates a data-binding between HTML text value and + * * {@link angular.directive.ng:bind ng:bind} - Creates a data-binding between HTML text value and * data model. - * * {@link angular.Directive.ng:bind-attr ng:bind-attr} - Creates a data-binding as in `ng:bind`, + * * {@link angular.directive.ng:bind-attr ng:bind-attr} - Creates a data-binding as in `ng:bind`, * but uses JSON key / value pairs. - * * {@link angular.Directive.ng:bind-template ng:bind-template} - Replaces text value of an element + * * {@link angular.directive.ng:bind-template ng:bind-template} - Replaces text value of an element * with a specified template. - * * {@link angular.Directive.ng:change ng:change} - Executes an expression when the value of an + * * {@link angular.directive.ng:change ng:change} - Executes an expression when the value of an * input widget changes. - * * {@link angular.Directive.ng:class ng:class} - Conditionally set CSS class on an element. - * * {@link angular.Directive.ng:class-even ng:class-even} - Like `ng:class`, but works in - * conjunction with {@link widget.@ng:repeat} to affect even rows in a collection. - * * {@link angular.Directive.ng:class-odd ng:class-odd} - Like `ng:class`, but works with {@link - * widget.@ng:repeat} to affect odd rows. - * * {@link angular.Directive.ng:click ng:click} - Executes custom behavior when element is clicked. - * * {@link angular.Directive.ng:controller ng:controller} - Creates a scope object linked to the + * * {@link angular.directive.ng:class ng:class} - Conditionally set CSS class on an element. + * * {@link angular.directive.ng:class-even ng:class-even} - Like `ng:class`, but works in + * conjunction with {@link angular.widget.@ng:repeat} to affect even rows in a collection. + * * {@link angular.directive.ng:class-odd ng:class-odd} - Like `ng:class`, but works with {@link + * angular.widget.@ng:repeat} to affect odd rows. + * * {@link angular.directive.ng:click ng:click} - Executes custom behavior when element is clicked. + * * {@link angular.directive.ng:controller ng:controller} - Creates a scope object linked to the * DOM element and assigns behavior to the scope. - * * {@link angular.Directive.ng:eval ng:eval} - Executes a binding but blocks output. - * * {@link angular.Directive.ng:eval-order ng:eval-order} - Change evaluation order when updating + * * {@link angular.directive.ng:eval ng:eval} - Executes a binding but blocks output. + * * {@link angular.directive.ng:eval-order ng:eval-order} - Change evaluation order when updating * the view. - * * {@link angular.Directive.ng:hide ng:hide} - Conditionally hides a portion of HTML. - * * {@link angular.Directive.ng:href ng:href} - Places an href in the angular namespace. - * * {@link angular.Directive.ng:init} - Initialization tasks run before a template is executed. - * * {@link angular.Directive.ng:show ng:show} - Conditionally displays a portion of HTML. - * * {@link angular.Directive.ng:src ng:src} - Places a `src` attribute into the angular namespace. - * * {@link angular.Directive.ng:style ng:style} - Conditionally set CSS styles on an element. - * * {@link angular.Directive.ng:submit} - Binds angular expressions to `onSubmit` events. + * * {@link angular.directive.ng:hide ng:hide} - Conditionally hides a portion of HTML. + * * {@link angular.directive.ng:href ng:href} - Places an href in the angular namespace. + * * {@link angular.directive.ng:init} - Initialization tasks run before a template is executed. + * * {@link angular.directive.ng:show ng:show} - Conditionally displays a portion of HTML. + * * {@link angular.directive.ng:src ng:src} - Places a `src` attribute into the angular namespace. + * * {@link angular.directive.ng:style ng:style} - Conditionally set CSS styles on an element. + * * {@link angular.directive.ng:submit} - Binds angular expressions to `onSubmit` events. * * For more information about how angular directives work, and how to create your own directives, - * see {@link guide/directives Understanding Angular Directives} in the angular Developer Guide. + * see {@link guide/dev_guide.compiler.directives Understanding Angular Directives} in the angular + * Developer Guide. */ /** @@ -50,7 +52,7 @@ * before the template enters execution mode during bootstrap. * * @element ANY - * @param {expression} expression {@link guide/expression Expression} to eval. + * @param {expression} expression {@link guide/dev_guide.expressions Expression} to eval. * * @example <doc:example> @@ -76,7 +78,7 @@ angularDirective("ng:init", function(expression){ /** * @workInProgress * @ngdoc directive - * @name angular.directive.@ng:controller + * @name angular.directive.ng:controller * * @description * The `ng:controller` directive assigns behavior to a scope. This is a key aspect of how angular @@ -94,8 +96,8 @@ angularDirective("ng:init", function(expression){ * * @element ANY * @param {expression} expression Name of a globally accessible constructor function or an - * {@link guide/expression expression} that on the current scope evaluates to a constructor - * function. + * {@link guide/dev_guide.expressions expression} that on the current scope evaluates to a + * constructor function. * * @example * Here is a simple form for editing user contact information. Adding, removing, clearing, and @@ -182,7 +184,7 @@ angularDirective("ng:controller", function(expression){ * without displaying the result to the user. * * @element ANY - * @param {expression} expression {@link guide/expression Expression} to eval. + * @param {expression} expression {@link guide/dev_guide.expressions Expression} to eval. * * @example * Notice that `{{` `obj.multiplied = obj.a * obj.b` `}}` has a side effect of assigning @@ -231,7 +233,7 @@ angularDirective("ng:eval", function(expression){ * `<span ng:bind="expression"></span>` at bootstrap time. * * @element ANY - * @param {expression} expression {@link guide/expression Expression} to eval. + * @param {expression} expression {@link guide/dev_guide.expressions Expression} to eval. * * @example * You can try it right here: enter text in the text box and watch the greeting change. @@ -390,10 +392,11 @@ var REMOVE_ATTRIBUTES = { * @name angular.directive.ng:bind-attr * * @description - * The `ng:bind-attr` attribute specifies that {@link guide/data-binding databindings} should be - * created between element attributes and given expressions. Unlike `ng:bind` the `ng:bind-attr` - * contains a JSON key value pairs representing which attributes need to be mapped to which - * {@link guide/expression expressions}. + * The `ng:bind-attr` attribute specifies that + * {@link guide/dev_guide.templates.databinding databindings} should be created between element + * attributes and given expressions. Unlike `ng:bind` the `ng:bind-attr` contains a JSON key value + * pairs representing which attributes need to be mapped to which + * {@link guide/dev_guide.expressions expressions}. * * You don't usually write the `ng:bind-attr` in the HTML since embedding * <tt ng:non-bindable>{{expression}}</tt> into the attribute directly as the attribute value is @@ -480,7 +483,7 @@ angularDirective("ng:bind-attr", function(expression){ * element is clicked. * * @element ANY - * @param {expression} expression {@link guide/expression Expression} to eval upon click. + * @param {expression} expression {@link guide/dev_guide.expressions Expression} to eval upon click. * * @example <doc:example> @@ -531,7 +534,7 @@ angularDirective("ng:click", function(expression, element){ * server and reloading the current page). * * @element form - * @param {expression} expression {@link guide/expression Expression} to eval. + * @param {expression} expression {@link guide/dev_guide.expressions Expression} to eval. * * @example <doc:example> @@ -594,7 +597,7 @@ function ngClass(selector) { * conditionally. * * @element ANY - * @param {expression} expression {@link guide/expression Expression} to eval. + * @param {expression} expression {@link guide/dev_guide.expressions Expression} to eval. * * @example <doc:example> @@ -635,8 +638,8 @@ angularDirective("ng:class", ngClass(function(){return true;})); * and takes affect only on odd (even) rows. * * @element ANY - * @param {expression} expression {@link guide/expression Expression} to eval. Must be inside - * `ng:repeat`. + * @param {expression} expression {@link guide/dev_guide.expressions Expression} to eval. Must be + * inside `ng:repeat`. * * @example <doc:example> @@ -673,8 +676,8 @@ angularDirective("ng:class-odd", ngClass(function(i){return i % 2 === 0;})); * and takes affect only on odd (even) rows. * * @element ANY - * @param {expression} expression {@link guide/expression Expression} to eval. Must be inside - * `ng:repeat`. + * @param {expression} expression {@link guide/dev_guide.expressions Expression} to eval. Must be + * inside `ng:repeat`. * * @example <doc:example> @@ -710,8 +713,8 @@ angularDirective("ng:class-even", ngClass(function(i){return i % 2 === 1;})); * conditionally. * * @element ANY - * @param {expression} expression If the {@link guide/expression expression} is truthy then the element - * is shown or hidden respectively. + * @param {expression} expression If the {@link guide/dev_guide.expressions expression} is truthy + * then the element is shown or hidden respectively. * * @example <doc:example> @@ -751,8 +754,8 @@ angularDirective("ng:show", function(expression, element){ * of the HTML conditionally. * * @element ANY - * @param {expression} expression If the {@link guide/expression expression} truthy then the element - * is shown or hidden respectively. + * @param {expression} expression If the {@link guide/dev_guide.expressions expression} truthy then + * the element is shown or hidden respectively. * * @example <doc:example> @@ -791,8 +794,9 @@ angularDirective("ng:hide", function(expression, element){ * The ng:style allows you to set CSS style on an HTML element conditionally. * * @element ANY - * @param {expression} expression {@link guide/expression Expression} which evals to an object whose - * keys are CSS style names and values are corresponding values for those CSS keys. + * @param {expression} expression {@link guide/dev_guide.expressions Expression} which evals to an + * object whose keys are CSS style names and values are corresponding values for those CSS + * keys. * * @example <doc:example> diff --git a/src/filters.js b/src/filters.js index d77adc57..63dbbd7f 100644 --- a/src/filters.js +++ b/src/filters.js @@ -12,16 +12,18 @@ * * Following is the list of built-in angular filters: * - * * {@link angular.Filter.currency currency} - * * {@link angular.Filter.date date} - * * {@link angular.Filter.html html} - * * {@link angular.Filter.json json} - * * {@link angular.Filter.linky linky} - * * {@link angular.Filter.lowercase lowercase} - * * {@link angular.Filter.number number} - * * {@link angular.Filter.uppercase uppercase} - * - * For more information about how angular filters work, and how to create your own filters, see {@link guide/filters Understanding Angular Filters} in the angular Developer Guide. + * * {@link angular.filter.currency currency} + * * {@link angular.filter.date date} + * * {@link angular.filter.html html} + * * {@link angular.filter.json json} + * * {@link angular.filter.linky linky} + * * {@link angular.filter.lowercase lowercase} + * * {@link angular.filter.number number} + * * {@link angular.filter.uppercase uppercase} + * + * For more information about how angular filters work, and how to create your own filters, see + * {@link guide/dev_guide.templates.filters Understanding Angular Filters} in the angular Developer + * Guide. */ /** diff --git a/src/formatters.js b/src/formatters.js index d9b0a9fe..906db619 100644 --- a/src/formatters.js +++ b/src/formatters.js @@ -9,15 +9,16 @@ * * Following is the list of built-in angular formatters: * - * * {@link angular.Formatter.boolean boolean} - Formats user input in boolean format - * * {@link angular.Formatter.index index} - Manages indexing into an HTML select widget - * * {@link angular.Formatter.json json} - Formats user input in JSON format - * * {@link angular.Formatter.list list} - Formats user input string as an array - * * {@link angular.Formatter.number} - Formats user input strings as a number - * * {@link angular.Formatter.trim} - Trims extras spaces from end of user input + * * {@link angular.formatter.boolean boolean} - Formats user input in boolean format + * * {@link angular.formatter.index index} - Manages indexing into an HTML select widget + * * {@link angular.formatter.json json} - Formats user input in JSON format + * * {@link angular.formatter.list list} - Formats user input string as an array + * * {@link angular.formatter.number} - Formats user input strings as a number + * * {@link angular.formatter.trim} - Trims extras spaces from end of user input * * For more information about how angular formatters work, and how to create your own formatters, - * see {@link guide/filters Understanding Angular Formatters} in the angular Developer Guide. + * see {@link guide/dev_guide.templates.formatters Understanding Angular Formatters} in the angular + * Developer Guide. */ function formatter(format, parse) {return {'format':format, 'parse':parse || format};} diff --git a/src/jqLite.js b/src/jqLite.js index ab4674fe..c86c265a 100644 --- a/src/jqLite.js +++ b/src/jqLite.js @@ -2,6 +2,58 @@ //JQLite ////////////////////////////////// +/** + * @workInProgress + * @ngdoc function + * @name angular.element + * @function + * + * @description + * Wraps a raw DOM element or HTML string as [jQuery](http://jquery.com) element. + * `angular.element` is either an alias for [jQuery](http://api.jquery.com/jQuery/) function if + * jQuery is loaded or a function that wraps the element or string in angular's jQuery lite + * implementation. + * + * Real jQuery always takes precedence (as long as it was loaded before `DOMContentEvent`) + * + * Angular's jQuery lite implementation is a tiny API-compatible subset of jQuery which allows + * angular to manipulate DOM. The jQuery lite implements only a subset of jQuery api, with the + * focus on the most commonly needed functionality and minimal footprint. For this reason only a + * limited number of jQuery methods, arguments and invocation styles are supported. + * + * NOTE: All element references in angular are always wrapped with jQuery (lite) and are never + * raw DOM references. + * + * ## Angular's jQuery lite implements these functions: + * + * - [addClass()](http://api.jquery.com/addClass/) + * - [after()](http://api.jquery.com/after/) + * - [append()](http://api.jquery.com/append/) + * - [attr()](http://api.jquery.com/attr/) + * - [bind()](http://api.jquery.com/bind/) + * - [children()](http://api.jquery.com/children/) + * - [clone()](http://api.jquery.com/clone/) + * - [css()](http://api.jquery.com/css/) + * - [data()](http://api.jquery.com/data/) + * - [hasClass()](http://api.jquery.com/hasClass/) + * - [parent()](http://api.jquery.com/parent/) + * - [remove()](http://api.jquery.com/remove/) + * - [removeAttr()](http://api.jquery.com/removeAttr/) + * - [removeClass()](http://api.jquery.com/removeClass/) + * - [removeData()](http://api.jquery.com/removeData/) + * - [replaceWith()](http://api.jquery.com/replaceWith/) + * - [text()](http://api.jquery.com/text/) + * - [trigger()](http://api.jquery.com/trigger/) + * + * ## Additionally these methods extend the jQuery and are available in both jQuery and jQuery lite + * version: + * + *- `scope()` - retrieves the current angular scope of the element. + * + * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery. + * @returns {Object} jQuery object. + */ + var jqCache = {}, jqName = 'ng-' + new Date().getTime(), jqId = 1, diff --git a/src/markups.js b/src/markups.js index 2a9b1c3e..1f2ec8a6 100644 --- a/src/markups.js +++ b/src/markups.js @@ -1,3 +1,52 @@ +/** + * @workInProgress + * @ngdoc overview + * @name angular.markup + * @description + * + * Angular markup transforms content of DOM elements or portions of this content into other text or + * DOM elements for further compilation. + * + * Markup extensions do not themselves produce linking functions. Think of markup as a way to + * produce shorthand for a {@link angular.widget widget} or a {@link angular.directive directive}. + * + * The most prominent example of an markup in angular is the built-in double curly markup + * `{{expression}}`, which is a shorthand for `<span ng:bind="expression"></span>`. + * + * Create custom markup like this: + * + * <pre> + * angular.markup('newMarkup', function(text, textNode, parentElement){ + * //tranformation code + * }); + * </pre> + * + * For more information about angular markup, see {@link guide/dev_guide.compiler.markup + * Understanding Angular Markup} in the angular Developer Guide. + */ + +/** + * @workInProgress + * @ngdoc overview + * @name angular.attrMarkup + * @description + * + * Attribute markup extends the angular compiler in a very similar way as {@link angular.markup} + * except that it allows you to modify the state of the attribute text rather then the content of a + * node. + * + * Create custom attribute markup like this: + * + * <pre> + * angular.attrMarkup('newAttrMarkup', function(attrValue, attrName, element){ + * //tranformation code + * }); + * </pre> + * + * For more information about angular attribute markup, see {@link guide/dev_guide.compiler.markup + * Understanding Angular Markup} in the angular Developer Guide. + */ + function parseBindings(string) { var results = []; var lastIndex = 0; diff --git a/src/validators.js b/src/validators.js index db5d01f3..43378cb6 100644 --- a/src/validators.js +++ b/src/validators.js @@ -9,23 +9,24 @@ * * Following is the list of built-in angular validators: * - * * {@link angular.Validator.asynchronous asynchronous()} - Provides asynchronous validation via a + * * {@link angular.validator.asynchronous asynchronous()} - Provides asynchronous validation via a * callback function. - * * {@link angular.Validator.date date()} - Checks user input against default date format: + * * {@link angular.validator.date date()} - Checks user input against default date format: * "MM/DD/YYYY" - * * {@link angular.Validator.email email()} - Validates that user input is a well-formed email + * * {@link angular.validator.email email()} - Validates that user input is a well-formed email * address. - * * {@link angular.Validator.integer integer()} - Validates that user input is an integer - * * {@link angular.Validator.json json()} - Validates that user input is valid JSON - * * {@link angular.Validator.number number()} - Validates that user input is a number - * * {@link angular.Validator.phone phone()} - Validates that user input matches the pattern + * * {@link angular.validator.integer integer()} - Validates that user input is an integer + * * {@link angular.validator.json json()} - Validates that user input is valid JSON + * * {@link angular.validator.number number()} - Validates that user input is a number + * * {@link angular.validator.phone phone()} - Validates that user input matches the pattern * "1(123)123-1234" - * * {@link angular.Validator.regexp regexp()} - Restricts valid input to a specified regular + * * {@link angular.validator.regexp regexp()} - Restricts valid input to a specified regular * expression pattern - * * {@link angular.Validator.url url()} - Validates that user input is a well-formed URL. + * * {@link angular.validator.url url()} - Validates that user input is a well-formed URL. * * For more information about how angular validators work, and how to create your own validators, - * see {@link guide/validators Understanding Angular Validators} in the angular Developer Guide. + * see {@link guide/dev_guide.templates.validators Understanding Angular Validators} in the angular + * Developer Guide. */ extend(angularValidator, { diff --git a/src/widgets.js b/src/widgets.js index c923b551..2ccf4a1f 100644 --- a/src/widgets.js +++ b/src/widgets.js @@ -9,20 +9,20 @@ * * Following is the list of built-in angular widgets: * - * * {@link angular.Widget.@ng:format ng:format} - Formats data for display to user and for storage. - * * {@link angular.Widget.@ng:non-bindable ng:non-bindable} - Blocks angular from processing an + * * {@link angular.widget.@ng:format ng:format} - Formats data for display to user and for storage. + * * {@link angular.widget.@ng:non-bindable ng:non-bindable} - Blocks angular from processing an * HTML element. - * * {@link angular.Widget.@ng:repeat ng:repeat} - Creates and manages a collection of cloned HTML + * * {@link angular.widget.@ng:repeat ng:repeat} - Creates and manages a collection of cloned HTML * elements. - * * {@link angular.Widget.@ng:required ng:required} - Verifies presence of user input. - * * {@link angular.Widget.@ng:validate ng:validate} - Validates content of user input. - * * {@link angular.Widget.HTML HTML} - Standard HTML processed by angular. - * * {@link angular.Widget.ng:view ng:view} - Works with $route to "include" partial templates - * * {@link angular.Widget.ng:switch ng:switch} - Conditionally changes DOM structure - * * {@link angular.Widget.ng:include ng:include} - Includes an external HTML fragment + * * {@link angular.widget.@ng:required ng:required} - Verifies presence of user input. + * * {@link angular.widget.@ng:validate ng:validate} - Validates content of user input. + * * {@link angular.widget.HTML HTML} - Standard HTML processed by angular. + * * {@link angular.widget.ng:view ng:view} - Works with $route to "include" partial templates + * * {@link angular.widget.ng:switch ng:switch} - Conditionally changes DOM structure + * * {@link angular.widget.ng:include ng:include} - Includes an external HTML fragment * - * For more information about angular widgets, see {@link guide/widgets Understanding Angular - * Widgets} in the angular Developer Guide. + * For more information about angular widgets, see {@link guide/dev_guide.compiler.widgets + * Understanding Angular Widgets} in the angular Developer Guide. */ /** |
