Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Commits on Nov 26, 2013
  1. Tobias Bosch

    fix($sanitize): Use same whitelist mechanism as $compile does.

    tbosch authored
    `$sanitize` now uses the same mechanism as `$compile` to validate uris.
    By this, the validation in `$sanitize` is more general and can be
    configured in the same way as the one in `$compile`.
    
    Changes
    - Creates the new private service `$$sanitizeUri`.
    - Moves related specs from `compileSpec.js` into `sanitizeUriSpec.js`.
    - Refactors the `linky` filter to be less dependent on `$sanitize`
      internal functions.
    
    Fixes #3748.
Commits on Nov 14, 2013
  1. Vojta Jina

    fix(loader): don't rely on internal APIs

    vojtajina authored
    This significantly increases the size of the loader:
    - minified: 1031bytes -> 1509bytes (+46%)
    - minified + gzip: 593bytes -> 810bytes (+36%)
    
    I'm not entirely sold on the idea of shipping minErr with the loade. With the current state, the angular-loader behavior is completely broken - this is just a quick fix, we can revisit this change in the future.
    
    
    Closes #4437
    Closes #4874
Commits on Oct 22, 2013
  1. Pete Bacon Darwin Vojta Jina

    chore(grunt): add jshint tasks

    petebacondarwin authored vojtajina committed
Commits on Oct 7, 2013
  1. Julie Ralph Vojta Jina

    feat($interval): add a service wrapping setInterval

    juliemr authored vojtajina committed
    The $interval service simplifies creating and testing recurring tasks.
    This service does not increment $browser's outstanding request count,
    which means that scenario tests and Protractor tests will not timeout
    when a site uses a polling function registered by $interval. Provides
    a workaround for #2402.
    
    For unit tests, repeated tasks can be controlled using ngMock$interval's
    tick(), tickNext(), and tickAll() functions.
Commits on Aug 23, 2013
  1. Igor Minar
  2. Matias Niemelä Miško Hevery

    feat(ngMock): add support for creating dynamic style sheets within te…

    matsko authored mhevery committed
    …st code
Commits on Aug 9, 2013
  1. Brian Ford Igor Minar

    chore(ngMobile): rename module ngTouch and file to angular-touch.js

    btford authored IgorMinar committed
    BREAKING CHANGE: since all the code in the ngMobile module is touch related,
    we are renaming the module to ngTouch.
    
    To migrate, please replace all references to "ngMobile" with "ngTouch" and
    "angular-mobile.js" to "angular-touch.js".
    
    Closes #3526
Commits on Jul 30, 2013
  1. Ken Sheedlo

    fix(bower): update bower usage and resources

    ksheedlo authored
    Changes:
    - Fix our old code to use bower_components/ as the install dir
    - Fix the Bootstrap asset to use github.com/twbs/bootstrap (it moved)
    - Fail the build on Bower failure. Bower should not fail silently.
Commits on Jul 27, 2013
  1. Matias Niemelä Miško Hevery

    feat(ngAnimate): complete rewrite of animations

    matsko authored mhevery committed
    - ngAnimate directive is gone and was replaced with class based animations/transitions
    - support for triggering animations on css class additions and removals
    - done callback was added to all animation apis
    - $animation and $animator where merged into a single $animate service with api:
      - $animate.enter(element, parent, after, done);
      - $animate.leave(element, done);
      - $animate.move(element, parent, after, done);
      - $animate.addClass(element, className, done);
      - $animate.removeClass(element, className, done);
    
    BREAKING CHANGE: too many things changed, we'll write up a separate doc with migration instructions
Commits on Jul 25, 2013
  1. Chirayu Krishnappa

    feat(ngBindHtml, sce): combine ng-bind-html and ng-bind-html-unsafe

    chirayuk authored
    Changes:
    - remove ng-bind-html-unsafe
    - ng-bind-html is now in core
    - ng-bind-html is secure
      - supports SCE - so you can bind to an arbitrary trusted string
      - automatic sanitization if $sanitize is available
    
    BREAKING CHANGE:
      ng-html-bind-unsafe has been removed and replaced by ng-html-bind
      (which has been removed from ngSanitize.)  ng-bind-html provides
      ng-html-bind-unsafe like behavior (innerHTML's the result without
      sanitization) when bound to the result of $sce.trustAsHtml(string).
      When bound to a plain string, the string is sanitized via $sanitize
      before being innerHTML'd.  If $sanitize isn't available, it's logs an
      exception.
  2. Chirayu Krishnappa

    feat($sce): new $sce service for Strict Contextual Escaping.

    chirayuk authored
    $sce is a service that provides Strict Contextual Escaping services to AngularJS.
    
    Strict Contextual Escaping
    --------------------------
    
    Strict Contextual Escaping (SCE) is a mode in which AngularJS requires
    bindings in certain contexts to result in a value that is marked as safe
    to use for that context One example of such a context is binding
    arbitrary html controlled by the user via ng-bind-html-unsafe.  We
    refer to these contexts as privileged or SCE contexts.
    
    As of version 1.2, Angular ships with SCE enabled by default.
    
    Note:  When enabled (the default), IE8 in quirks mode is not supported.
    In this mode, IE8 allows one to execute arbitrary javascript by the use
    of the expression() syntax.  Refer
    http://blogs.msdn.com/b/ie/archive/2008/10/16/ending-expressions.aspx
    to learn more about them.  You can ensure your document is in standards
    mode and not quirks mode by adding <!doctype html> to the top of your
    HTML document.
    
    SCE assists in writing code in way that (a) is secure by default and (b)
    makes auditing for security vulnerabilities such as XSS, clickjacking,
    etc. a lot easier.
    
    Here's an example of a binding in a privileged context:
    
      <input ng-model="userHtml">
      <div ng-bind-html-unsafe="{{userHtml}}">
    
    Notice that ng-bind-html-unsafe is bound to {{userHtml}} controlled by
    the user.  With SCE disabled, this application allows the user to render
    arbitrary HTML into the DIV.  In a more realistic example, one may be
    rendering user comments, blog articles, etc. via bindings.  (HTML is
    just one example of a context where rendering user controlled input
    creates security vulnerabilities.)
    
    For the case of HTML, you might use a library, either on the client side, or on the server side,
    to sanitize unsafe HTML before binding to the value and rendering it in the document.
    
    How would you ensure that every place that used these types of bindings was bound to a value that
    was sanitized by your library (or returned as safe for rendering by your server?)  How can you
    ensure that you didn't accidentally delete the line that sanitized the value, or renamed some
    properties/fields and forgot to update the binding to the sanitized value?
    
    To be secure by default, you want to ensure that any such bindings are disallowed unless you can
    determine that something explicitly says it's safe to use a value for binding in that
    context.  You can then audit your code (a simple grep would do) to ensure that this is only done
    for those values that you can easily tell are safe - because they were received from your server,
    sanitized by your library, etc.  You can organize your codebase to help with this - perhaps
    allowing only the files in a specific directory to do this.  Ensuring that the internal API
    exposed by that code doesn't markup arbitrary values as safe then becomes a more manageable task.
    
    In the case of AngularJS' SCE service, one uses $sce.trustAs (and
    shorthand methods such as $sce.trustAsHtml, etc.) to obtain values that
    will be accepted by SCE / privileged contexts.
    
    In privileged contexts, directives and code will bind to the result of
    $sce.getTrusted(context, value) rather than to the value directly.
    Directives use $sce.parseAs rather than $parse to watch attribute
    bindings, which performs the $sce.getTrusted behind the scenes on
    non-constant literals.
    
    As an example, ngBindHtmlUnsafe uses $sce.parseAsHtml(binding
    expression).  Here's the actual code (slightly simplified):
    
      var ngBindHtmlUnsafeDirective = ['$sce', function($sce) {
        return function(scope, element, attr) {
          scope.$watch($sce.parseAsHtml(attr.ngBindHtmlUnsafe), function(value) {
            element.html(value || '');
          });
        };
      }];
    
    Impact on loading templates
    ---------------------------
    
    This applies both to the ng-include directive as well as templateUrl's
    specified by directives.
    
    By default, Angular only loads templates from the same domain and
    protocol as the application document.  This is done by calling
    $sce.getTrustedResourceUrl on the template URL.  To load templates from
    other domains and/or protocols, you may either either whitelist them or
    wrap it into a trusted value.
    
    *Please note*:
    The browser's Same Origin Policy and Cross-Origin Resource Sharing
    (CORS) policy apply in addition to this and may further restrict whether
    the template is successfully loaded.  This means that without the right
    CORS policy, loading templates from a different domain won't work on all
    browsers.  Also, loading templates from file:// URL does not work on
    some browsers.
    
    This feels like too much overhead for the developer?
    ----------------------------------------------------
    
    It's important to remember that SCE only applies to interpolation expressions.
    
    If your expressions are constant literals, they're automatically trusted
    and you don't need to call $sce.trustAs on them.
    e.g.  <div ng-html-bind-unsafe="'<b>implicitly trusted</b>'"></div> just works.
    
    Additionally, a[href] and img[src] automatically sanitize their URLs and
    do not pass them through $sce.getTrusted.  SCE doesn't play a role here.
    
    The included $sceDelegate comes with sane defaults to allow you to load
    templates in ng-include from your application's domain without having to
    even know about SCE.  It blocks loading templates from other domains or
    loading templates over http from an https served document.  You can
    change these by setting your own custom whitelists and blacklists for
    matching such URLs.
    
    This significantly reduces the overhead.  It is far easier to pay the
    small overhead and have an application that's secure and can be audited
    to verify that with much more ease than bolting security onto an
    application later.
Commits on Jul 19, 2013
  1. Chirayu Krishnappa
Commits on Jun 28, 2013
  1. Vojta Jina
  2. Vojta Jina

    chore: remove jstd leftovers

    vojtajina authored
Commits on Jun 17, 2013
  1. Ken Sheedlo Igor Minar

    chore(minErr): replace ngError with minErr

    ksheedlo authored IgorMinar committed
Commits on Jun 10, 2013
  1. Matias Niemelä
Commits on Jun 7, 2013
  1. Matias Niemelä Igor Minar
  2. Matias Niemelä Igor Minar
  3. Igor Minar

    refactor($route): pull $route and friends into angular-route.js

    IgorMinar authored
    $route, $routeParams and ngView have been pulled from core angular.js
    to angular-route.js/ngRoute module.
    
    This is was done to in order keep the core focused on most commonly
    used functionality and allow community routers to be freely used
    instead of $route service.
    
    There is no need to panic, angular-route will keep on being supported
    by the angular team.
    
    Note: I'm intentionally not fixing tutorial links. Tutorial will need
    bigger changes and those should be done when we update tutorial to
    1.2.
    
    BREAKING CHANGE: applications that use $route will now need to load
    angular-route.js file and define dependency on ngRoute module.
    
    Before:
    
    ```
    ...
    <script src="angular.js"></script>
    ...
    var myApp = angular.module('myApp', ['someOtherModule']);
    ...
    ```
    
    After:
    
    ```
    ...
    <script src="angular.js"></script>
    <script src="angular-route.js"></script>
    ...
    var myApp = angular.module('myApp', ['ngRoute', 'someOtherModule']);
    ...
    ```
    
    Closes #2804
Commits on May 25, 2013
  1. Igor Minar Vojta Jina

    feat(ngError): add error message compression and better error messages

    IgorMinar authored vojtajina committed
    - add toThrowNg matcher
Commits on May 23, 2013
  1. Jeff Cross

    feat($swipe): Refactor swipe logic from ngSwipe to $swipe service.

    Braden Shepherdson authored jeffbcross committed
    This new service is used by the ngSwipeLeft/Right directives, and by the
    separate ngCarousel and swipe-to-delete directives which are under
    development.
Commits on May 20, 2013
  1. Matias Niemelä Miško Hevery

    chore(ngdocs): move angular-bootstrap.js to be generated only inside …

    matsko authored mhevery committed
    …the docs and remove from the build process
Commits on Apr 19, 2013
  1. Oren Avissar Pete Bacon Darwin

    feat(ngIf): add directive to remove and recreate DOM elements

    OrenAvissar authored petebacondarwin committed
    This directive is adapted from ui-if in the AngularUI project and provides a complement
    to the ngShow/ngHide directives that only change the visibility of the DOM element and
    ngSwitch which does change the DOM but is more verbose.
Commits on Apr 18, 2013
  1. Igor Minar

    test(modules): fix module tests which got disabled by ngMobile

    IgorMinar authored
    When ngMobile was merged in, we accidentaly included angular-scenario.js
    in the test file set for modules. Loading this file overrode jasmine's
    `it` and `describe` global functions which essentially disabled all of
    ~200 unit tests for wrapped modules.
    
    This change refactors the code to run the wrapped module tests.
    
    I had to extract browserTrigger from scenario runner in order to achieve
    this without code duplication.
Commits on Apr 11, 2013
  1. Igor Minar

    feat(ngSwipe): Add ngSwipeRight/Left directives to ngMobile

    Braden Shepherdson authored IgorMinar committed
    These directives fire an event handler on a touch-and-drag or
    click-and-drag to the left or right. Includes unit tests and docs
    update. Manually tested on Chrome 26, IE8, Android Chrome and iOS
    Safari.
Commits on Apr 3, 2013
  1. Miško Hevery
Commits on Apr 2, 2013
  1. Miško Hevery
Commits on Apr 1, 2013
  1. Vojta Jina

    chore: use Karma

    vojtajina authored
Commits on Mar 14, 2013
  1. Igor Minar

    feat(ngMobile): add ngMobile module with mobile-specific ngClick

    Braden Shepherdson authored IgorMinar committed
    Add a new module ngMobile, with mobile/touch-specific directives.
    Add ngClick, which overrides the default ngClick. This ngClick uses touch
    events, which are much faster on mobile. On desktop browsers, ngClick
    responds to click events, so it can be used for portable sites.
Commits on Jan 17, 2013
  1. Igor Minar

    chore(Rakefile): remove a duplicate file in angularFiles.js

    James deBoer authored IgorMinar committed
Commits on Sep 13, 2012
  1. Igor Minar

    chore(testing): Testacular config files + rake tasks

    IgorMinar authored
    - adds testacular config files for jqlite, jquery, modules and e2e tests
    - replaces obsolete JsTD Rake tasks with Testacular onces
    - rake tasks are parameterazied so that they can be used locally as well as on CI server
    
    usage:
    
    rake test  # run all tests on Chrome
    rake test[Safari+Chrome+Opera]  # run all tests on Safari, Chrome and Opera
    rake test[Safari]  # run all tests on Safari
    rake test:jqlite # run unit tests using jqlite on Chrome
    rake test:jqlite[Safari,"--reporter=dots"]  # run jqlite-based unit tests on Safari with dots reporter
    rake autotest:jquery  # start testacular with jquery-based config and watch fs for changes
    rake test:e2e # run end to end tests
Commits on Jun 12, 2012
  1. Igor Minar
Commits on May 23, 2012
  1. Igor Minar

    feat($timeout): add $timeout service that supersedes $defer

    IgorMinar authored
    $timeout has a better name ($defer got often confused with something related to $q) and
    is actually promise based with cancelation support.
    
    With this commit the $defer service is deprecated and will be removed before 1.0.
    
    Closes #704, #532
Commits on May 7, 2012
  1. Miško Hevery
Commits on May 4, 2012
  1. Miško Hevery
Something went wrong with that request. Please try again.