Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-scenario

Package Overview
Dependencies
Maintainers
2
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-scenario - npm Package Versions

1
10

1.4.5

Diff

Changelog

Source

1.4.5 permanent-internship (2015-08-28)

Bug Fixes

  • $animate: $animate.enabled(false) should disable animations on $animateCss as well (c3d5e33e, #12696, #12685)
  • $animateCss:
  • ngAnimate:
  • ngModel: validate pattern against the viewValue (0e001084, #12344)
  • ngResources: support IPv6 URLs (b643f0d3, #12512, #12532)

Breaking Changes

The ngPattern and pattern directives will validate the regex against the viewValue of ngModel, i.e. the value of the model before the $parsers are applied. Previously, the modelValue (the result of the $parsers) was validated.

This fixes issues where input[date] and input[number] cannot be validated because the viewValue string is parsed into Date and Number respectively (starting with AngularJS 1.3). It also brings the directives in line with HTML5 constraint validation, which validates against the input value.

This change is unlikely to cause applications to fail, because even in AngularJS 1.2, the value that was validated by pattern could have been manipulated by the $parsers, as all validation was done inside this pipeline.

If you rely on the pattern being validated against the modelValue, you must create your own validator directive that overwrites the built-in pattern validator:

.directive('patternModelOverwrite', function patternModelOverwriteDirective() {
  return {
    restrict: 'A',
    require: '?ngModel',
    priority: 1,
    compile: function() {
      var regexp, patternExp;

      return {
        pre: function(scope, elm, attr, ctrl) {
          if (!ctrl) return;

          attr.$observe('pattern', function(regex) {
            /**
             * The built-in directive will call our overwritten validator
             * (see below). We just need to update the regex.
             * The preLink fn guarantees our observer is called first.
             */
            if (isString(regex) && regex.length > 0) {
              regex = new RegExp('^' + regex + '$');
            }

            if (regex && !regex.test) {
              //The built-in validator will throw at this point
              return;
            }

            regexp = regex || undefined;
          });

        },
        post: function(scope, elm, attr, ctrl) {
          if (!ctrl) return;

          regexp, patternExp = attr.ngPattern || attr.pattern;

          //The postLink fn guarantees we overwrite the built-in pattern validator
          ctrl.$validators.pattern = function(value) {
            return ctrl.$isEmpty(value) ||
              isUndefined(regexp) ||
              regexp.test(value);
          };
        }
      };
    }
  };
});

<a name="1.3.18"></a>

angularcore
published 1.3.18 •

Changelog

Source

1.3.18 collective-penmanship (2015-08-18)

Bug Fixes

<a name="1.4.4"></a>

angularcore
published 1.4.4 •

Changelog

Source

1.4.4 pylon-requirement (2015-08-13)

Bug Fixes

Features

Performance Improvements

Breaking Changes

  • ngAnimate: due to 32d3cbb3, CSS classes added/removed by ngAnimate are now applied synchronously once the first digest has passed.

The previous behavior involved ngAnimate having to wait for one requestAnimationFrame before CSS classes were added/removed. The CSS classes are now applied directly after the first digest that is triggered after $animate.addClass, $animate.removeClass or $animate.setClass is called. If any of your code relies on waiting for one frame before checking for CSS classes on the element then please change this behavior. If a parent class-based animation, however, is run through a JavaScript animation which triggers an animation for beforeAddClass and/or beforeRemoveClass then the CSS classes will not be applied in time for the children (and the parent class-based animation will not be cancelled by any child animations).

  • $q due to 6838c979, When writing tests, there is no need to call $timeout.flush() to resolve a call to $q.when with a value.

The previous behavior involved creating an extra promise that needed to be resolved. This is no longer needed when $q.when is called with a value. In the case that the test is not aware if $q.when is called with a value or another promise, it is possible to replace $timeout.flush(); with $timeout.flush(0);.

describe('$q.when', function() {
  it('should not need a call to $timeout.flush() to resolve already resolved promises',
      inject(function($q, $timeout) {
    $q.when('foo');
    // In AngularJS 1.4.3 a call to `$timeout.flush();` was needed
    $timeout.verifyNoPendingTasks();
  }));

  it('should accept $timeout.flush(0) when not sure if $q.when was called with a value or a promise',
      inject(function($q, $timeout) {
    $q.when('foo');
    $timeout.flush(0);
    $timeout.verifyNoPendingTasks();
  }));

  it('should need a call to $timeout.flush() to resolve $q.when when called with a promise',
        inject(function($q, $timeout) {
    $q.when($q.when('foo'));
    $timeout.flush();
    $timeout.verifyNoPendingTasks();
  }));
});
  • form: Due to 94533e57, the name attribute of form elements can now only contain characters that can be evaluated as part of an Angular expression. This is because Angular uses the value of name as an assignable expression to set the form on the $scope. For example, name="myForm" assigns the form to $scope.myForm and name="myObj.myForm" assigns it to $scope.myObj.myForm.

    Previously, it was possible to also use names such name="my:name", because Angular used a special setter function for the form name. Now the general, more robust $parse setter is used.

    The easiest way to migrate your code is therefore to remove all special characters from the name attribute.

    If you need to keep the special characters, you can use the following directive, which will replace the name with a value that can be evaluated as an expression in the compile function, and then re-set the original name in the postLink function. This ensures that (1), the form is published on the scope, and (2), the form has the original name, which might be important if you are doing server-side form submission.

    angular.module('myApp').directive('form', function() {
      return {
        restrict: 'E',
        priority: 1000,
        compile: function(element, attrs) {
          var unsupportedCharacter = ':'; // change accordingly
          var originalName = attrs.name;
          if (attrs.name && attrs.name.indexOf(unsupportedCharacter) > 0) {
            attrs.$set('name', 'this["' + originalName + '"]');
          }
    
          return postLinkFunction(scope, element) {
            // Don't trigger $observers
            element.setAttribute('name', originalName);
          }
        }
      };
    });
    

<a name="1.4.3"></a>

angularcore
published 1.4.3 •

Changelog

Source

1.4.3 foam-acceleration (2015-07-15)

Bug Fixes

<a name="1.4.2"></a>

angularcore
published 1.3.17 •

Changelog

Source

1.3.17 tsktskskly-euouae (2015-07-06)

Bug Fixes

<a name="1.4.1"></a>

angularcore
published 1.4.2 •

Changelog

Source

1.4.2 nebular-readjustment (2015-07-06)

Bug Fixes

Features

Breaking Changes

  • ngInclude: due to 3c6e8ce044446735eb2e70d0061db8c6db050289, the src attribute of ngInclude no longer accepts an expression that returns the result of $sce.trustAsResourceUrl. This will now cause an infinite digest:

Before:

<div ng-include="findTemplate('https://example.com/myTemplate.html')"></div>
$scope.findTemplate = function(templateName) {
  return $sce.trustAsResourceUrl(templateName);
};

To migrate, either cache the result of trustAsResourceUrl(), or put the template url in the resource whitelist in the config() function:

After:

var templateCache = {};
$scope.findTemplate = function(templateName) {
  if (!templateCache[templateName]) {
    templateCache[templateName] = $sce.trustAsResourceUrl(templateName);
  }

  return  templateCache[templateName];
};

// Alternatively, use `$sceDelegateProvider.resourceUrlWhitelist()`:

angular.module('myApp', []).config(function($sceDelegateProvider) {
  $sceDelegateProvider.resourceUrlWhitelist(['self', 'https://example.com/**'])
});

<a name="1.3.17"></a>

angularcore
published 1.4.1 •

Changelog

Source

1.4.1 hyperionic-illumination (2015-06-16)

Bug Fixes

Features

Performance Improvements

  • $compile: avoid jquery data calls when there is no data (9efb0d5e)

<a name="1.3.16"></a>

angularcore
published 1.3.16 •

Changelog

Source

1.3.16 cookie-oatmealification (2015-06-05)

Bug Fixes

  • $compile: throw error on invalid directive name (634e4671, #11281, #11109)
  • $cookies: update $cookies to prevent duplicate cookie writes and play nice with external code (706a93ab, #11490, #11515)
  • $http: throw error if success and error methods do not receive a function (731e1f65, #11330, #11333)
  • core: ensure that multiple requests to requestAnimationFrame are buffered (0adc0364, #11791)
  • filterFilter: fix matching against null/undefined (9dd0fe35, #11573, #11617)
  • jqLite:
    • check for "length" in obj in isArrayLike to prevent iOS8 JIT bug from surfacing (647f3f55, #11508)
    • attr should ignore comment, text and attribute nodes (181e5ebc)
  • ngAnimate:
    • ensure that minified repaint code isn't removed (d5c99ea4, #9936)
  • ngAria: handle elements with role="checkbox/menuitemcheckbox" (1c282af5, #11317, #11321)
  • ngModel: allow setting model to NaN when asyncValidator is present (b64519fe, #11315, #11411)
  • ngTouch:
  • select: prevent unknown option being added to select when bound to null property (9e3f82bb, #11872, #11875)

Features

<a name="1.4.0"></a>

angularcore
published 1.4.0 •

Changelog

Source

1.4.0 jaracimrman-existence (2015-05-26)

Bug Fixes

  • $animate:
  • $animateCss: ensure that custom durations do not confuse the gcs cache (e0e1b520, #11723, #11852)
  • $http: do not modify the config object passed into $http short methods (f7a4b481)
  • ngAnimate:
    • close follow-up class-based animations when the same class is added/removed when removed/added (db246eb7, #11717)
    • ensure nested class-based animations are spaced out with a RAF (213c2a70, #11812)
    • class-based animations must not set addClass/removeClass CSS classes on the element (3a3db690, #11810)
    • ensure that repeated structural calls during pre-digest function (2327f5a0, #11867)
    • ensure that cancelled class-based animations are properly cleaned up (718ff844, #11652)
    • throw an error if a callback is passed to animate methods (9bb4d6cc, #11826, #11713)
    • ensure anchored animations remove the leave element at correct time (64c66d0e, #11850)
  • select: prevent unknown option being added to select when bound to null property (4090491c, #11872, #11875)

Features

<a name="1.4.0-rc.2"></a>

angularcore
published 1.4.0-rc.2 •

Changelog

Source

1.4.0-rc.2 rocket-zambonimation (2015-05-12)

Bug Fixes

  • $compile: ensure directive names have no leading or trailing whitespace (bab474aa, #11397, #11772)
  • $httpParamSerializerJQLike: follow jQuery logic for nested params (2420a0a7, #11551, #11635)
  • jqLite: check for "length" in obj in isArrayLike to prevent iOS8 JIT bug from surfacing (426a5ac0, #11508)
  • ngAnimate:
    • ensure that multiple requests to requestAnimationFrame are buffered (db20b830, #11791)
    • ensure that an object is always returned even when no animation is set to run (d5683d21)
    • force use of ng-anchor instead of a suffixed -anchor CSS class when triggering anchor animations (df24410c)
    • rename ng-animate-anchor to ng-anchor (e6d053de)
    • ensure that shared CSS classes between anchor nodes are retained (e0014002, #11681)
    • prohibit usage of the ng-animate class with classNameFilter (1002b80a, #11431, #11807)
    • ensure that the temporary CSS classes are applied before detection (f7e9ff1a, #11769, #11804)
    • ensure that all jqLite elements are deconstructed properly (64d05180, #11658)
    • ensure animations are not attempted on text nodes (2aacc2d6, #11703)
    • ensure JS animations recognize $animateCss directly (0681a540)
  • ngClass: add/remove classes which are properties of Object.prototype (f7b99970, #11813, #11814)
  • ngOptions:
  • ngTouch:
    • check undefined tagName for SVG event target (74eb17d7)
    • don't prevent click event after a touchmove (95521876, #10985)

Features

  • $resource: include request context in error message (266bc652, #11363)

Breaking Changes

  • ngAnimate - $animateCss: due to d5683d21, The $animateCss service will now always return an object even if the animation is not set to run. If your code is using $animateCss then please consider the following code change:
// before
var animator = $animateCss(element, { ... });
if (!animator) {
  continueApp();
  return;
}
var runner = animator.start();
runner.done(continueApp);
runner.then(continueApp);

// now
var animator = $animateCss(element, { ... });
var runner = animator.start();
runner.done(continueApp);
runner.then(continueApp);
  • due to df24410c, Prior to this fix there were to ways to apply CSS animation code to an anchor animation. With this fix, the suffixed CSS -anchor classes are now not used anymore for CSS anchor animations.

Instead just use the ng-anchor CSS class like so:

<div class="container-animation" ng-if="on">
   <div ng-animate-ref="1" class="my-anchor-element"></div>
</div>

<div class="container-animation" ng-if="!on">
   <div ng-animate-ref="1" class="my-anchor-element"></div>
</div>

before:

/* before (notice the container-animation CSS class) */
.container-animation-anchor {
  transition:0.5s linear all;
}

now:

/* now (just use `ng-anchor` on a class that both the
   elements that contain `ng-animate-ref` share) */
.my-anchor-element.ng-anchor {
  transition:0.5s linear all;
}
  • due to e6d053de, if your CSS code made use of the ng-animate-anchor CSS class for referencing the anchored animation element then your code must now use ng-anchor instead.

  • due to 1002b80a, partially or fully using a regex value containing ng-animate as a token is not allowed anymore. Doing so will trigger a minErr exception to be thrown.

So don't do this:

// only animate elements that contain the `ng-animate` CSS class
$animateProvider.classNameFilter(/ng-animate/);

// or partially contain it
$animateProvider.classNameFilter(/some-class ng-animate another-class/);

but this is OK:

$animateProvider.classNameFilter(/ng-animate-special/);

Although it is unlikely that anyone is using it in this way, this change does change the behavior of ngOptions in the following case:

  • you are iterating over an array-like object, using the array form of the ngOptions syntax (item.label for item in items) and that object contains non-numeric property keys.

In this case these properties with non-numeric keys will be ignored.

** Here array-like is defined by the result of a call to this internal function: https://github.com/angular/angular.js/blob/v1.4.0-rc.1/src/Angular.js#L198-L211 **

To get the desired behavior you need to iterate using the object form of the ngOptions syntax (value.label for (key, value) in items)`).

<a name="v1.4.0-rc.1"></a>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc