"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/ng/directive/ngStyle.js" between
angular.js-1.7.9.tar.gz and angular.js-1.8.0.tar.gz

About: AngularJS is a web application framework that assists with creating single-page applications that only require HTML, CSS, and JavaScript on the client side.

ngStyle.js  (angular.js-1.7.9):ngStyle.js  (angular.js-1.8.0)
skipping to change at line 45 skipping to change at line 45
</file> </file>
<file name="style.css"> <file name="style.css">
span { span {
color: black; color: black;
} }
</file> </file>
<file name="protractor.js" type="protractor"> <file name="protractor.js" type="protractor">
var colorSpan = element(by.css('span')); var colorSpan = element(by.css('span'));
it('should check ng-style', function() { it('should check ng-style', function() {
expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)'); expect(colorSpan.getCssValue('color')).toMatch(/rgba\(0, 0, 0, 1\)|rgb\ (0, 0, 0\)/);
element(by.css('input[value=\'set color\']')).click(); element(by.css('input[value=\'set color\']')).click();
expect(colorSpan.getCssValue('color')).toBe('rgba(255, 0, 0, 1)'); expect(colorSpan.getCssValue('color')).toMatch(/rgba\(255, 0, 0, 1\)|rg b\(255, 0, 0\)/);
element(by.css('input[value=clear]')).click(); element(by.css('input[value=clear]')).click();
expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)'); expect(colorSpan.getCssValue('color')).toMatch(/rgba\(0, 0, 0, 1\)|rgb\ (0, 0, 0\)/);
}); });
</file> </file>
</example> </example>
*/ */
var ngStyleDirective = ngDirective(function(scope, element, attr) { var ngStyleDirective = ngDirective(function(scope, element, attr) {
scope.$watchCollection(attr.ngStyle, function ngStyleWatchAction(newStyles, ol dStyles) { scope.$watchCollection(attr.ngStyle, function ngStyleWatchAction(newStyles, ol dStyles) {
if (oldStyles && (newStyles !== oldStyles)) { if (oldStyles && (newStyles !== oldStyles)) {
forEach(oldStyles, function(val, style) { element.css(style, ''); }); forEach(oldStyles, function(val, style) { element.css(style, ''); });
} }
if (newStyles) element.css(newStyles); if (newStyles) element.css(newStyles);
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)