mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-24 14:58:36 +08:00
chore(): begin adding ionic components to mono-repo.
This commit is contained in:
@ -0,0 +1,9 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { PageOne } from '../pages/page-one/page-one';
|
||||
|
||||
@Component({
|
||||
template: '<ion-nav [root]="root"></ion-nav>'
|
||||
})
|
||||
export class AppComponent {
|
||||
root = PageOne;
|
||||
}
|
19
packages/ionic-angular/demos/src/platform/app/app.module.ts
Normal file
19
packages/ionic-angular/demos/src/platform/app/app.module.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { BrowserModule } from '@angular/platform-browser';
|
||||
import { IonicApp, IonicModule } from '../../../../src';
|
||||
|
||||
import { AppComponent } from './app.component';
|
||||
import { PageOneModule } from '../pages/page-one/page-one.module';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AppComponent
|
||||
],
|
||||
imports: [
|
||||
BrowserModule,
|
||||
IonicModule.forRoot(AppComponent),
|
||||
PageOneModule
|
||||
],
|
||||
bootstrap: [IonicApp]
|
||||
})
|
||||
export class AppModule {}
|
5
packages/ionic-angular/demos/src/platform/app/main.ts
Normal file
5
packages/ionic-angular/demos/src/platform/app/main.ts
Normal file
@ -0,0 +1,5 @@
|
||||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
||||
|
||||
import { AppModule } from './app.module';
|
||||
|
||||
platformBrowserDynamic().bootstrapModule(AppModule);
|
@ -0,0 +1,88 @@
|
||||
<ion-header>
|
||||
|
||||
<ion-navbar>
|
||||
<ion-title>Platform</ion-title>
|
||||
</ion-navbar>
|
||||
|
||||
</ion-header>
|
||||
|
||||
|
||||
<ion-content class="platform-demo">
|
||||
|
||||
<p margin class="note">Change devices to see the platform values change.</p>
|
||||
|
||||
<ion-grid>
|
||||
<ion-row>
|
||||
<ion-col><b>Name</b></ion-col>
|
||||
<ion-col><b>Value</b></ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<pre>platform.is('ios')</pre>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<pre [ngClass]="isIos ? 'platform-true' : 'platform-false'">{{isIos}}</pre>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<pre>platform.is('android')</pre>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<pre [ngClass]="isAndroid ? 'platform-true' : 'platform-false'">{{isAndroid}}</pre>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
<ion-row>
|
||||
<ion-col>
|
||||
<pre>platform.is('windows')</pre>
|
||||
</ion-col>
|
||||
<ion-col>
|
||||
<pre [ngClass]="isWindows ? 'platform-true' : 'platform-false'">{{isWindows}}</pre>
|
||||
</ion-col>
|
||||
</ion-row>
|
||||
</ion-grid>
|
||||
|
||||
</ion-content>
|
||||
|
||||
<style>
|
||||
.platform-demo ion-row ion-col:nth-child(odd) {
|
||||
flex: 0 0 62%;
|
||||
max-width: 62%;
|
||||
}
|
||||
|
||||
.platform-demo ion-row ion-col:nth-child(even) {
|
||||
flex: 0 0 38%;
|
||||
max-width: 38%;
|
||||
}
|
||||
|
||||
.platform-demo pre {
|
||||
background: #f8f8f8;
|
||||
font-size: 13px;
|
||||
min-height: 40px;
|
||||
padding: 4px;
|
||||
margin-top: 0;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 2px;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.platform-demo .platform-true {
|
||||
background: #dff2bf;
|
||||
border-color: #4f8a10;
|
||||
}
|
||||
|
||||
.platform-demo .platform-false {
|
||||
background: #ffbaba;
|
||||
border-color: #d8000c;
|
||||
}
|
||||
|
||||
.platform-demo .platform-normal {
|
||||
background: #bde5f8;
|
||||
border-color: #00529b;
|
||||
}
|
||||
|
||||
.platform-demo .note {
|
||||
color: #444;
|
||||
font-style: italic;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { IonicPageModule } from '../../../../../src';
|
||||
|
||||
import { PageOne } from './page-one';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
PageOne,
|
||||
],
|
||||
imports: [
|
||||
IonicPageModule.forChild(PageOne),
|
||||
],
|
||||
entryComponents: [
|
||||
PageOne,
|
||||
]
|
||||
})
|
||||
export class PageOneModule {}
|
@ -0,0 +1,17 @@
|
||||
import { Component } from '@angular/core';
|
||||
import { Platform } from '../../../../../src';
|
||||
|
||||
@Component({
|
||||
templateUrl: 'page-one.html'
|
||||
})
|
||||
export class PageOne {
|
||||
isIos: boolean;
|
||||
isAndroid: boolean;
|
||||
isWindows: boolean;
|
||||
|
||||
constructor(platform: Platform) {
|
||||
this.isIos = platform.is('ios');
|
||||
this.isAndroid = platform.is('android');
|
||||
this.isWindows = platform.is('windows');
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user