Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit af285dd

Browse files
committed
Added ng:options directive
Closes #301
1 parent 89e001b commit af285dd

File tree

9 files changed

+498
-159
lines changed

9 files changed

+498
-159
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,19 @@
33

44
### New Features
55
- Added prepend() to jqLite
6+
- Added ng:options directive (http://docs.angularjs.org/#!angular.directive.ng:options)
67

78

89
### Bug Fixes
910
- Number filter would return incorrect value when fractional part had leading zeros.
1011

12+
1113
### Breaking changes
1214
- $service now has $service.invoke for method injection ($service(self, fn) no longer works)
1315
- injection name inference no longer supports method curry and linking functions. Both must be
1416
explicitly specified using $inject property.
17+
- Dynamic Iteration (ng:repeater) on <option> elements is no longer supported. Use ng:options
18+
1519

1620

1721
<a name="0.9.16"><a/>

src/Angular.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ if ('i' !== 'I'.toLowerCase()) {
5252
function fromCharCode(code) { return String.fromCharCode(code); }
5353

5454

55-
var $$element = '$element',
56-
$$update = '$update',
55+
var _undefined = undefined,
56+
_null = null,
57+
$$element = '$element',
5758
$$scope = '$scope',
5859
$$validate = '$validate',
5960
$angular = 'angular',

src/directives.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -443,10 +443,8 @@ var REMOVE_ATTRIBUTES = {
443443
angularDirective("ng:bind-attr", function(expression){
444444
return function(element){
445445
var lastValue = {};
446-
var updateFn = element.data($$update) || noop;
447446
this.$onEval(function(){
448-
var values = this.$eval(expression),
449-
dirty = noop;
447+
var values = this.$eval(expression);
450448
for(var key in values) {
451449
var value = compileBindTemplate(values[key]).call(this, element),
452450
specialName = REMOVE_ATTRIBUTES[lowercase(key)];
@@ -464,10 +462,8 @@ angularDirective("ng:bind-attr", function(expression){
464462
} else {
465463
element.attr(key, value);
466464
}
467-
dirty = updateFn;
468465
}
469466
}
470-
dirty();
471467
}, element);
472468
};
473469
});

src/formatters.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ angularFormatter.trim = formatter(
204204
* @workInProgress
205205
* @ngdoc formatter
206206
* @name angular.formatter.index
207+
* @deprecated
207208
* @description
208209
* Index formatter is meant to be used with `select` input widget. It is useful when one needs
209210
* to select from a set of objects. To create pull-down one can iterate over the array of object
@@ -250,6 +251,7 @@ angularFormatter.trim = formatter(
250251
</doc:scenario>
251252
</doc:example>
252253
*/
254+
//TODO: delete me since this is replaced by ng:options
253255
angularFormatter.index = formatter(
254256
function(object, array){
255257
return '' + indexOf(array || [], object);

src/parser.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,8 @@ function parser(text, json){
239239
pipeFunction =
240240
function (){ throwError("is not valid json", {text:text, index:0}); };
241241
}
242+
//TODO: Shouldn't all of the public methods have assertAllConsumed?
243+
//TODO: I think these should be public as part of the parser api instead of scope.$eval().
242244
return {
243245
assignable: assertConsumed(assignable),
244246
primary: assertConsumed(primary),
@@ -659,4 +661,3 @@ function parser(text, json){
659661

660662

661663

662-

0 commit comments

Comments
 (0)