Sunday, June 10, 2012

AngularJS 1.0.0rc11 promise-resolution released!

The last planned RC with all the promised changes is here!

Features

  • $route:
    • allow defining route async dependencies as promises and defer route change until all promises are resolved (885fb0dd)
    • rename template -> tempalteUrl and add support for inline templates (0a6e464a)
  • $compile: simplify isolate scope bindings and introduce true two-way data-binding between parent scope and isolate scope (c3a41ff9)
  • $injector: provide API for retrieving function annotations (4361efb0)
  • $location: add $locatonChange[start|success] event - since events are cancelable, it's now possible to cancel route and location changes. (92a2e180)
  • $rootElement: expose application root element as $rootElement service (85632cb4)

Bug Fixes

  • $compile: correctly merge class attr for replace directives (contributed by Max Martinsson, fb99b539, #1006)
  • $http: add utf-8 to default Content-Type header (post/put) (10f80d7d)
  • $timeout: allow calling $timeout.cancel() with undefined (contributed by Ali Mills, 1904596e)
  • jqLite: don't eat event exceptions (416a7830)

Breaking Changes

  • $beforeRouteChange and $routeChangeStart events were renamed to $afterRouteChange and $routeChangeSuccess
    This was done to make the naming consistent with $location events and also get events to categorize and order nicely just by alphabetical sorting.
    (7c242821)
  • template option in $route definition was renamed to templateUrl
    The template options in $route definition now represents the actual template string. To provide the template url use templateUrl option instead. This was done to unify the directive and $route definitions.
    To migrate just rename template to templateUrl. (0a6e464a)
  • isolate scope bindings definition has changed
    To migrate the code follow the example below:
    Before:
    scope: {
      myAttr: 'attribute',
      myBind: 'bind',
      myExpression: 'expression',
      myEval: 'evaluate',
      myAccessor: 'accessor'
    }
    
    After:
    scope: {
      myAttr: '@',
      myBind: '@',
      myExpression: '&',
      // myEval - usually not useful, but in cases where the expression is assignable, you can use '='
      myAccessor: '=' // in directive's template change myAccessor() to myAccessor
    }
    
  • the inject option for the directive controller injection was removed
    The removed inject wasn't generally useful for directives so there should be no code using it. (c3a41ff9)

Download

Links

Join our meetups

If you what to learn more about AngularJS and you are in one of San Francisco, Seattle or NYC areas then we invite you to join our meetups:

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.