Skip to content
Commits on Jul 1, 2016
  1. @petebacondarwin @Narretz
  2. @Narretz
  3. @Narretz

    fix(select): handle model updates when options are manipulated

    These rules follow ngOptions behavior:
    - when an option that is currently selected, is removed or its value changes, the model
    is set to null.
    - when an an option is added or its value changes to match the currently selected model,
    this option is selected.
    - when an option is disabled, the model is set to null.
    - when the model value changes to a value that matches a disabled option,
    this option is selected (analogue to ngOptions)
    Narretz committed May 21, 2016
  4. @Narretz @Narretz

    feat(select): support values of any type added with ngValue

    select elements with ngModel will now set ngModel to option values added by ngValue.
    This allows setting values of any type (not only strings) without the use of ngOptions.
    Interpolations inside attributes can only be strings, but the ngValue directive uses attrs.$set,
    which does not have any type restriction. Any $observe on the value attribute will therefore receive
    the original value (result of ngValue expression). However, when a user selects an option, the browser
    sets the select value to the actual option's value attribute, which is still always a string.
    For that reason, when options are added by ngValue, we set the hashed value of the original value in
    the value attribute and store the actual value in an extra map. When the select value changes, we
    read access the actual value via the hashed select value.
    Since we only use a hashed value for ngValue, we will have extra checks for the hashed values:
    - when options are read, for both single and multiple select
    - when options are written, for multiple select
    I don't expect this to have a performance impact, but it should be kept in mind.
    Closes #9842
    Closes #6297
    `<option>` elements added to `<select ng-model>` via `ngValue` now add their values in hash form, i.e.
    `<option ng-value="myString">` becomes `<option ng-value="myString" value="string:myString">`.
    This is done to support binding options with values of any type to selects.
    This should rarely affect applications, as the values of options are usually not relevant to the
    application logic, but it's possible that option values are checked in tests.
    Narretz committed with Narretz Feb 6, 2016
  5. @mmuppa @petebacondarwin
  6. @petebacondarwin
  7. @Narretz @petebacondarwin

    docs(guide): create new page for external resources

    The official and external resources  have been split into two different guide sections. Official stays at the index, external gets its own page.
    The external resources have also been reorganized and updated, but
    I haven't checked if all material is still relevant.
    Narretz committed with petebacondarwin Oct 9, 2015
Commits on Jun 29, 2016
  1. @peabnuts123 @gkalpak

    fix(ngMocks): allow `ErrorAddingDeclarationLocationStack` to be recog…

    …nized as an `Error`
    Change `ErrorAddingDeclarationLocationStack`'s prototype so test frameworks (such as Jasmine 2.x)
    are able to recognize it as `Error`.
    Fixes #13821
    Closes #14344
    peabnuts123 committed with gkalpak Mar 30, 2016
Commits on Jun 28, 2016
  1. @Narretz

    test(input): ensure Date objects work for min/max in date input types

    Tests that
    - interpolated Date objects work for min/max
    - Date objects work for ng-min/ng-max
    Narretz committed Jun 22, 2016
  2. @Narretz

    fix(ngBind): use same string representation as $interpolate

    Fixes #11716
    `ngBind` now uses the same logic as $interpolate (i.e. {{myString}}) when
    binding, which means values other than strings are now transformed as following:
    - null / undefined become empty string
    - with an object's custom toString() function, except if the object is a Date, Array, or Number
    - otherwise with JSON.stringify
    Previously, ngBind would use always use toString().
    The following examples show the different output:
    $scope.myPlainObject = {a: 1, b: 2};
    $scope.myCustomObject = {a: 1, b: 2, toString: function() {return 'a+b';}};
    Plain Object:
    <!-- Before: -->
    <span ng-bind="myPlainObject">[object Object]</span>
    <!-- After: -->
    <span ng-bind="myPlainObject">{"a":1,"b":2}</span>
    Object with custom toString():
    <!-- Before: -->
    <span ng-bind="myCustomObject">[object Object]</span>
    <!-- After: -->
    <span ng-bind="myCustomObject">a+b</span>
    If you want the output of `toString()`, you can use it directly on the value in ngBind:
    <span ng-bind="myObject.toString()">[object Object]</span>
    Narretz committed Jun 5, 2016
  3. @Narretz

    feat($interpolate): use custom toString() function if present

    Except on Numbers, Dates and Arrays.
    Thanks to @danielkrainas for the initial implementation of this feature.
    This behavior is consistent with implementations found in other languages such as Ruby, Python,
    and CoffeeScript.
    The commit also exposes a private $$stringify method on the angular global, so that ngMessageFormat
    can use the same logic without duplicating it.
    Fixes #7317
    Closes #8350
    Fixes #11406
    When converting values to strings, interpolation now uses a custom toString() function on objects
    that are not Number, Array or Date (custom means that the `toString` function is not the same as
    `Object.prototype.toString`). Otherwise, interpolation uses JSON.stringify() as usual.
    Should you have a custom toString() function but still want the output of JSON.stringify(),
    migrate as shown in the following examples:
    After - use the `json` filter to stringify the object:
    <span>{{myObject | json}}</span>
    Narretz committed Jun 22, 2016
  4. @atenhar @gkalpak

    docs(tutorial/step_03): fix grammar and typos

    Closes #14834
    atenhar committed with gkalpak Jun 27, 2016
Commits on Jun 27, 2016
  1. @nicholasserra @gkalpak

    fix($resource): add semicolon to whitelist of delimiters to unencode …

    …in URL params
    The unencoding happens in methods `encodeUriQuery`/`encodeUriSegment`. Both core and `ngResource`
    used to have identical implementations of these methods. Due to this duplication, the
    implementations got out-of-sync.
    Specifically, the semicolon has been added to the whitelist of unencoded characters in core since
    `v1.3.0-beta.18`. See 3625803 for more info.
    This commit fixes the problem and the underlying cause by reusing core's methods in `ngResource`.
    (The methods are exposed as private helpers on `window.angular`.)
    Closes #14309
    nicholasserra committed with gkalpak Mar 23, 2016
  2. @gkalpak
  3. @gkalpak @gkalpak

    fix($injector): fix class detection RegExp

    Mentioned in #14531 (comment).
    Closes #14533
    gkalpak committed with gkalpak Apr 28, 2016
  4. @gkalpak
  5. @gkalpak

    fix($animate): do not get affected by custom, enumerable properties o…

    …n `Object.prototype`
    Fixes #14804
    Closes #14830
    gkalpak committed Jun 26, 2016
Commits on Jun 26, 2016
  1. @lirantal @gkalpak
Commits on Jun 25, 2016
  1. @deplay @gkalpak
  2. @guillaumegarcia13 @gkalpak
Commits on Jun 23, 2016
  1. @Narretz
Commits on Jun 22, 2016
  1. @chirayuk @petebacondarwin
  2. @Narretz

    fix(ngAnimate): allow removal of class that is scheduled to be added …

    …with requestAnimationFrame
    Also affects the reverse case, adding a class that is scheduled to be removed with rAF.
    The following case can happen when ngClass updates an element's classes in very quick order in the following way:
    - First animation adds class "a"
    - A digest passes, but "a" is not yet added to the element
    - Second animation adds class "b"
    - No digest passes, and "a" is still not added to the element,
      because requestAnimationFrame hasn't been flushed yet
    - Third animation removes class "a"
    - the third animation gets merged into the second animation
    Before this change:
    - Because the element doesn't have class "a" yet, ngAnimate
    resolves that it cannot remove class "a". However,
    the first animation is still running, and finally adds "a"
    After this change:
    - ngAnimate reacts to the temporary class "add-a", which indicates
    that "a" is about to be added and decides that "a" can be removed
    after all.
    This is a very rare case where setting the element's class
    is not fast enough, and subsequent animations operate on incorrect assumptions.
    "In the wild", this is caused by rapidly updating ngClass,
    which uses inidvidual addClass and removeClass calls when both operations happen in a single digest.
    Fixes #14582
    PR  (#14760)
    Narretz committed on GitHub Jun 22, 2016
  3. @petebacondarwin
  4. @petebacondarwin
  5. @petebacondarwin
  6. @petebacondarwin
  7. @zbjornson @petebacondarwin

    feat($compile): backport $doCheck

    Backuport ngDoCheck from Angular 2.
    Closes #14656
    zbjornson committed with petebacondarwin May 23, 2016
Commits on Jun 21, 2016
  1. @petebacondarwin

    refact($http): use the $jsonpCallbacks service

    Use the built-in service to handling callbacks to `$http.jsonp` requests.
    Closes #3073
    Closes #14795
    petebacondarwin committed Jun 21, 2016
  2. @petebacondarwin

    feat($jsonpCallbacks): new service to abstract how JSONP callbacks ar…

    …e handled
    You can now override this service if you have specific requirements about
    the behaviour and formatting of the JSON_CALLBACK that is sent to the server
    for `$http.jsonp` requests.
    Closes #14795
    petebacondarwin committed Jun 17, 2016
Commits on Jun 17, 2016
  1. @gkalpak

    fix(modules): allow modules to be loaded in any order when using `ang…

    Some modules used to assume that the angular helpers would always be available when their script was
    executed. This could be a problem when using `angular-loader` and the module file happened to get
    loaded before the core `angular.js` file.
    This commit fixes the issue by delaying the access to angular helpers, until they are guaranteed to
    be available.
    Affected modules:
    - `ngAnimate`
    - `ngMessageFormat`
    - `ngMessages`
    - `ngRoute`
    - `ngSanitize`
    Fixes #9140
    Closes #14794
    gkalpak committed Jun 16, 2016
  2. @gkalpak
  3. @petebacondarwin
  4. @yihangho @petebacondarwin

    feat($q): implement $q.race

    Implement $q.race. $q.race takes in an array or hash of promises and
    returns a promise that resolves or rejects as soon as one of those promises
    resolves or rejects, with the value or reason from that promise.
    Closes #12929
    Closes #14757
    yihangho committed with petebacondarwin Jun 16, 2016
  5. @abenchi @petebacondarwin

    feat($swipe): add pointer support

    Add pointer events to $swipe to support IE11 on touch devices
    Closes #14061
    Closes #14791
    abenchi committed with petebacondarwin Jun 16, 2016
Something went wrong with that request. Please try again.