mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
refactor(nav): add initial support for url in general, add integration w/ ng-router
This commit is contained in:
@ -62,7 +62,7 @@ export class ActionSheetPageComponent {
|
||||
}
|
||||
}]
|
||||
});
|
||||
actionSheet.present();
|
||||
return actionSheet.present();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,8 +2,8 @@ import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { By } from '@angular/platform-browser';
|
||||
import { IonicAngularModule } from '@ionic/angular';
|
||||
|
||||
import { SharedModule } from '../shared/shared.module';
|
||||
import { BasicInputsPageComponent } from './basic-inputs-page.component';
|
||||
|
||||
describe('InputsTestPageComponent', () => {
|
||||
@ -14,7 +14,7 @@ describe('InputsTestPageComponent', () => {
|
||||
async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [BasicInputsPageComponent],
|
||||
imports: [FormsModule, SharedModule],
|
||||
imports: [FormsModule, IonicAngularModule.forRoot()],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
}).compileComponents();
|
||||
})
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { IonicAngularModule } from '@ionic/angular';
|
||||
|
||||
import { GroupInputsPageComponent } from './group-inputs-page.component';
|
||||
import { SharedModule } from '../shared/shared.module';
|
||||
|
||||
describe('GroupInputsPageComponent', () => {
|
||||
let component: GroupInputsPageComponent;
|
||||
@ -12,7 +12,7 @@ describe('GroupInputsPageComponent', () => {
|
||||
beforeEach(
|
||||
async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [FormsModule, SharedModule],
|
||||
imports: [FormsModule, IonicAngularModule],
|
||||
declarations: [GroupInputsPageComponent],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA]
|
||||
}).compileComponents();
|
||||
|
@ -27,7 +27,7 @@ export class LoadingPageComponent {
|
||||
|
||||
clickMe() {
|
||||
const loading = this.loadingController.create({
|
||||
duration: 2000,
|
||||
duration: 1000,
|
||||
content: 'Ahem. Please wait.'
|
||||
});
|
||||
loading.present();
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
|
||||
@Component({
|
||||
@ -15,10 +15,11 @@ import { ModalController } from '@ionic/angular';
|
||||
<ul>
|
||||
<li>ngOnInit - {{ngOnInitDetection}}</li>
|
||||
</ul>
|
||||
<ion-button (click)="dismiss()">Close Modal</ion-button>
|
||||
<ion-button class="dismiss-btn" (click)="dismiss()">Close Modal</ion-button>
|
||||
</ion-content>
|
||||
</ion-page>
|
||||
`
|
||||
`,
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ModalPageToPresent {
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ModalPageToPresent } from './modal-page-to-present';
|
||||
@ -17,8 +17,9 @@ import { ModalPageToPresent } from './modal-page-to-present';
|
||||
<ion-button (click)="clickMe()">Open Basic Modal</ion-button>
|
||||
</ion-content>
|
||||
</ion-page>
|
||||
</ion-app>
|
||||
`
|
||||
</ion-app>,
|
||||
`,
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ModalPageComponent {
|
||||
|
||||
@ -31,5 +32,4 @@ export class ModalPageComponent {
|
||||
});
|
||||
return modal.present();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,27 +1,20 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { PopoverController } from '@ionic/angular';
|
||||
|
||||
@Component({
|
||||
selector: 'page-one',
|
||||
template: `
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-title>Page One</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
<ion-content>
|
||||
Page One
|
||||
<ul>
|
||||
<li>ngOnInit - {{ngOnInitDetection}}</li>
|
||||
</ul>
|
||||
</ion-content>
|
||||
<div style="height: 200px; background-color: blue">
|
||||
{{ngOnInitDetection}}
|
||||
<ion-button (click)="dismiss()">Close Popover</ion-button>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
export class PopoverPageToPresent {
|
||||
|
||||
ngOnInitDetection = 'initial';
|
||||
|
||||
constructor() {
|
||||
|
||||
constructor(private controller: PopoverController) {
|
||||
}
|
||||
|
||||
|
||||
@ -32,4 +25,7 @@ export class PopoverPageToPresent {
|
||||
}, 500);
|
||||
}
|
||||
|
||||
dismiss() {
|
||||
return this.controller.
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user