Fix(es6-shim): References #292. Adding in es6-shim to package.json. Change the for() iterator in segment.ts changed to use a simple for loop. Short circuit functions in segment.ts incase there are no buttons, just return.

This commit is contained in:
jbavari
2015-10-15 17:47:30 -06:00
parent 52aa0548e7
commit fbb80af3e5
2 changed files with 11 additions and 3 deletions

View File

@ -77,7 +77,12 @@ export class Segment extends Ion {
* @param {string} value Value of the button to select.
*/
selectFromValue(value) {
for(let button of this.buttons) {
if (this.buttons.length == 0) {
return;
}
//for(let button of this.buttons) {
for(var i = 0, j = this.buttons.length; i < j; i++) {
var button = this.buttons[i];
if(button.value === value) {
button.isActive = true;
}
@ -89,7 +94,9 @@ export class Segment extends Ion {
* @param {SegmentButton} segmentButton The button to select.
*/
selected(segmentButton) {
for(let button of this.buttons) {
//for(let button of this.buttons) {
for(var i = 0, j = this.buttons.length; i < j; i++) {
let button = this.buttons[i];
button.isActive = false;
}
segmentButton.isActive = true;

View File

@ -11,8 +11,9 @@
"link": "npm install && gulp src && npm link"
},
"dependencies": {
"angular2": "2.0.0-alpha.42",
"@reactivex/rxjs": "0.0.0-prealpha.3",
"angular2": "2.0.0-alpha.42",
"es6-shim": "^0.33.6",
"reflect-metadata": "0.1.1",
"zone.js": "0.5.8"
},