mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
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:
@ -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;
|
||||
|
@ -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"
|
||||
},
|
||||
|
Reference in New Issue
Block a user