mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
Trying to fix
This commit is contained in:
@ -9,8 +9,6 @@ import {Geo} from './geo';
|
|||||||
import {Weather} from './weather';
|
import {Weather} from './weather';
|
||||||
import {Flickr} from './flickr';
|
import {Flickr} from './flickr';
|
||||||
|
|
||||||
console.log('Imported', Geo, Weather, Flickr);
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'ion-app',
|
selector: 'ion-app',
|
||||||
appInjector: [Modal]
|
appInjector: [Modal]
|
||||||
@ -43,7 +41,7 @@ class WeatherApp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
showSettings() {
|
showSettings() {
|
||||||
this.Modal.show(SettingsModal).then((settingsModal) => {
|
this.Modal.open(SettingsModal).then((settingsModal) => {
|
||||||
this.settingsModal = settingsModal;
|
this.settingsModal = settingsModal;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -134,9 +132,39 @@ class WeatherApp {
|
|||||||
|
|
||||||
@IonicComponent(Modal)
|
@IonicComponent(Modal)
|
||||||
@IonicView({
|
@IonicView({
|
||||||
template: '<ion-view id="settings-modal"><ion-content padding><button primary (click)="close()">Close</button></ion-content></ion-view>'
|
template: `<ion-view id="settings-modal">
|
||||||
|
<ion-toolbar>
|
||||||
|
<ion-title>Settings</ion-title>
|
||||||
|
</ion-toolbar>
|
||||||
|
<ion-content padding>
|
||||||
|
<form (^submit)="doSubmit($event)" [ng-form-model]="settingsForm">
|
||||||
|
<ion-list>
|
||||||
|
<ion-input ion-item>
|
||||||
|
<ion-label>Units</ion-label>
|
||||||
|
<!--
|
||||||
|
<ion-segment ng-control="units">
|
||||||
|
<ion-segment-button value="standard" button>
|
||||||
|
°F
|
||||||
|
</ion-segment-button>
|
||||||
|
<ion-segment-button value="standard" button>
|
||||||
|
°C
|
||||||
|
</ion-segment-button>
|
||||||
|
</ion-segment>
|
||||||
|
-->
|
||||||
|
</ion-input>
|
||||||
|
</ion-list>
|
||||||
|
</form>
|
||||||
|
</ion-content>
|
||||||
|
</ion-view>`,
|
||||||
|
directives: [formDirectives]
|
||||||
})
|
})
|
||||||
export class SettingsModal extends Modal {}
|
export class SettingsModal extends Modal {
|
||||||
|
constructor(fb: FormBuilder) {
|
||||||
|
this.settingsForm = fb.group({
|
||||||
|
mapStyle: ['hybrid', Validators.required]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function main(ionicBootstrap) {
|
export function main(ionicBootstrap) {
|
||||||
ionicBootstrap(WeatherApp);
|
ionicBootstrap(WeatherApp);
|
||||||
|
@ -222,7 +222,11 @@ current-weather .current-temp {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#settings-modal {
|
#settings-modal {
|
||||||
|
background-color: rgba(0,0,0,0.8) !important;
|
||||||
|
}
|
||||||
|
#settings-modal ion-toolbar {
|
||||||
background-color: rgba(0,0,0,0.8);
|
background-color: rgba(0,0,0,0.8);
|
||||||
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
#settings-modal .item {
|
#settings-modal .item {
|
||||||
|
@ -12,17 +12,20 @@ import {IonicDirective, IonicComponent, IonicView} from '../../config/annotation
|
|||||||
|
|
||||||
@IonicDirective({
|
@IonicDirective({
|
||||||
selector: 'ion-segment',
|
selector: 'ion-segment',
|
||||||
|
//properties: ['value'],
|
||||||
host: {
|
host: {
|
||||||
'(change)': 'onChange($event.target.value)',
|
'(change)': 'onChange($event.target.value)',
|
||||||
'(input)': 'onChange($event.target.value)',
|
'(input)': 'onChange($event.target.value)',
|
||||||
'(blur)': 'onTouched()',
|
'(blur)': 'onTouched()',
|
||||||
'[value]': 'value',
|
//'[value]': 'value',
|
||||||
|
/*
|
||||||
'[class.ng-untouched]': 'cd.control?.untouched == true',
|
'[class.ng-untouched]': 'cd.control?.untouched == true',
|
||||||
'[class.ng-touched]': 'cd.control?.touched == true',
|
'[class.ng-touched]': 'cd.control?.touched == true',
|
||||||
'[class.ng-pristine]': 'cd.control?.pristine == true',
|
'[class.ng-pristine]': 'cd.control?.pristine == true',
|
||||||
'[class.ng-dirty]': 'cd.control?.dirty == true',
|
'[class.ng-dirty]': 'cd.control?.dirty == true',
|
||||||
'[class.ng-valid]': 'cd.control?.valid == true',
|
'[class.ng-valid]': 'cd.control?.valid == true',
|
||||||
'[class.ng-invalid]': 'cd.control?.valid == false'
|
'[class.ng-invalid]': 'cd.control?.valid == false'
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
export class SegmentControlValueAccessor {
|
export class SegmentControlValueAccessor {
|
||||||
@ -74,13 +77,15 @@ export class Segment {
|
|||||||
host: {
|
host: {
|
||||||
'(click)': 'buttonClicked($event)',
|
'(click)': 'buttonClicked($event)',
|
||||||
'(change)': 'onChange($event)',
|
'(change)': 'onChange($event)',
|
||||||
'[value]': 'value',
|
//'[value]': 'value',
|
||||||
|
/*
|
||||||
'[class.ng-untouched]': 'cd.control?.untouched == true',
|
'[class.ng-untouched]': 'cd.control?.untouched == true',
|
||||||
'[class.ng-touched]': 'cd.control?.touched == true',
|
'[class.ng-touched]': 'cd.control?.touched == true',
|
||||||
'[class.ng-pristine]': 'cd.control?.pristine == true',
|
'[class.ng-pristine]': 'cd.control?.pristine == true',
|
||||||
'[class.ng-dirty]': 'cd.control?.dirty == true',
|
'[class.ng-dirty]': 'cd.control?.dirty == true',
|
||||||
'[class.ng-valid]': 'cd.control?.valid == true',
|
'[class.ng-valid]': 'cd.control?.valid == true',
|
||||||
'[class.ng-invalid]': 'cd.control?.valid == false'
|
'[class.ng-invalid]': 'cd.control?.valid == false'
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user