mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
App annotation/mode attribute
This commit is contained in:
@ -1,4 +1,9 @@
|
||||
.segment-ios .ion-segment {
|
||||
|
||||
// iOS Segment
|
||||
// --------------------------------------------------
|
||||
|
||||
|
||||
.segment[mode="ios"] .ion-segment {
|
||||
> button,
|
||||
> [button] {
|
||||
border-width: 1px;
|
||||
|
@ -1,11 +1,12 @@
|
||||
import {View, Renderer, ElementRef, EventEmitter, onInit, Ancestor, forwardRef} from 'angular2/angular2';
|
||||
import {View, Renderer, ElementRef, EventEmitter, Ancestor, forwardRef} from 'angular2/angular2';
|
||||
import {Control, NgControl,NgFormControl} from 'angular2/forms';
|
||||
import {ControlGroup, ControlDirective} from 'angular2/forms'
|
||||
|
||||
import {IonicDirective, IonicComponent, IonicView} from '../../config/annotations'
|
||||
import {Ion} from '../ion';
|
||||
import {IonicConfig} from '../../config/config';
|
||||
import {IonicDirective, IonicComponent} from '../../config/annotations'
|
||||
import {dom} from 'ionic/util';
|
||||
|
||||
console.log(forwardRef(() => SegmentButton));
|
||||
|
||||
@IonicComponent({
|
||||
selector: 'ion-segment',
|
||||
@ -13,7 +14,6 @@ console.log(forwardRef(() => SegmentButton));
|
||||
properties: [
|
||||
'value'
|
||||
],
|
||||
lifecycle: [onInit],
|
||||
host: {
|
||||
'(click)': 'buttonClicked($event)',
|
||||
'(change)': 'onChange($event)',
|
||||
@ -32,12 +32,15 @@ console.log(forwardRef(() => SegmentButton));
|
||||
template: '<div class="ion-segment"><content></content></div>',
|
||||
directives: [forwardRef(() => SegmentButton)]
|
||||
})
|
||||
export class Segment {
|
||||
export class Segment extends Ion {
|
||||
constructor(
|
||||
cd: NgControl,
|
||||
elementRef: ElementRef,
|
||||
ionicConfig: IonicConfig,
|
||||
renderer: Renderer
|
||||
) {
|
||||
super(elementRef, ionicConfig);
|
||||
|
||||
this.ele = elementRef.nativeElement
|
||||
this.elementRef = elementRef;
|
||||
this.renderer = renderer;
|
||||
@ -50,10 +53,6 @@ export class Segment {
|
||||
this.buttons = [];
|
||||
}
|
||||
|
||||
onInit() {
|
||||
Segment.applyConfig(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by child SegmentButtons to bind themselves to
|
||||
* the Segment.
|
||||
@ -164,8 +163,7 @@ export class SegmentControlValueAccessor {
|
||||
host: {
|
||||
'(click)': 'buttonClicked($event)',
|
||||
'[class.active]': 'isActive'
|
||||
},
|
||||
lifecycle: [onInit]
|
||||
}
|
||||
})
|
||||
export class SegmentButton {
|
||||
constructor(
|
||||
|
@ -1,15 +1,11 @@
|
||||
import {Component} from 'angular2/angular2';
|
||||
import {formDirectives, FormBuilder, Validators, Control, ControlGroup} from 'angular2/forms';
|
||||
|
||||
import {IonicView} from 'ionic/ionic';
|
||||
import {App} from 'ionic/ionic';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'ion-app',
|
||||
appInjector: [FormBuilder]
|
||||
})
|
||||
@IonicView({
|
||||
@App({
|
||||
templateUrl: 'main.html',
|
||||
appInjector: [FormBuilder],
|
||||
directives: [formDirectives]
|
||||
})
|
||||
class IonicApp {
|
||||
@ -26,7 +22,3 @@ class IonicApp {
|
||||
event.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
export function main(ionicBootstrap) {
|
||||
ionicBootstrap(IonicApp);
|
||||
}
|
||||
|
Reference in New Issue
Block a user