how to remove text style on td in angularjs


var colorSpan = element(by.css('span'));

it('should check ng-style', function() {
expect(colorSpan.getCssValue('color')).toMatch(/rgba(0, 0, 0, 1)|rgb(0, 0, 0)/);
element(by.css('input[value='set color']')).click();
expect(colorSpan.getCssValue('color')).toMatch(/rgba(255, 0, 0, 1)|rgb(255, 0, 0)/);
element(by.css('input[value=clear]')).click();
expect(colorSpan.getCssValue('color')).toMatch(/rgba(0, 0, 0, 1)|rgb(0, 0, 0)/);
});

span {
color: black;
}

<input type="button" value="set color" ng-click="myStyle={color:'red'}">
<input type="button" value="set background" ng-click="myStyle={'background-color':'blue'}">
<input type="button" value="clear" ng-click="myStyle={}">
<br/>
<span ng-style="myStyle">Sample Text</span>
<pre>myStyle={{myStyle}}</pre>

www.codegrepper.com
www.stackoverflow.com

how to remove item from array javascript


var list = ["bar", "baz", "foo", "qux"];
list.shift()//["baz", "foo", "qux"]

var colors = ["red","blue","car","green"];
var carIndex = colors.indexOf("car");//get "car" index
//remove car from the colors array
colors.splice(carIndex, 1); // colors = ["red","blue","green"]

var ar = ['zero', 'one', 'two', 'three'];
ar.shift(); // returns "zero"
console.log( ar ); // ["one", "two", "three"]

var cars = ["mazda","honda","tesla"];
cars = []; // clear/empty the array

var fruits = ["Banana", "Orange", "Apple", "Mango", "Kiwi"];
document.getElementById("demo").innerHTML = fruits;

function myFunction() {
fruits.splice(2, 2);
document.getElementById("demo").innerHTML = fruits;
}

var array = ["Item", "Item", "Delete me!", "Item"]

array.splice(2,1) // array is now ["Item","Item","Item"]

www.codegrepper.com
www.stackoverflow.com