import { Component,ViewChild } from '@angular/core';
import { NavController } from 'ionic-angular';
import { Profile } from './profile';
@Component({
templateUrl: 'app/app.html'
})
export class AppComponent {
rootPage = Profile;
@ViewChild('content') nav;
openPage(p) {
this.nav.push(p);
}
}
/*
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
*/
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule } from 'ionic-angular';
import { AppComponent } from './app.component';
import {Profile} from "./profile";
import {ModalPage} from "./modal-page";
@NgModule({
imports: [ BrowserModule, IonicModule.forRoot(AppComponent) ],
declarations: [ AppComponent,Profile,ModalPage],
entryComponents: [ Profile,ModalPage ],
bootstrap: [ IonicApp ],
providers:[]
})
export class AppModule { }
/*
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
*/
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule);
/*
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
*/
<!DOCTYPE html>
<html>
<head>
<title>Ionic 2 QuickStart</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 1. Load libraries -->
<!-- Polyfill(s) for older browsers -->
<script src="https://unpkg.com/core-js@2.4.1/client/shim.min.js"></script>
<script src="https://unpkg.com/zone.js@0.8.12?main=browser"></script>
<script src="https://unpkg.com/systemjs@0.19.40/dist/system.src.js"></script>
<!-- 2. Configure SystemJS -->
<script src="systemjs.config.js"></script>
<link href="https://unpkg.com/ionic-angular@3.4.0/css/ionic.css" rel="stylesheet">
<link rel="stylesheet" href="app/profile.css">
<link rel="stylesheet" href="app/app.css">
</head>
<!-- 3. Display the application -->
<body>
<ion-app></ion-app>
<script>
System.import('app').catch(function(err){ console.error(err); });
</script>
</body>
</html>
<!--
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
-->
### Ionic 2 Plunk
Basic Ionic 2 plunk based on the Angular QuickStart plunk.
/**
* PLUNKER VERSION
* (based on systemjs.config.js in angular.io)
* System configuration for Angular samples
* Adjust as necessary for your application needs.
*/
(function (global) {
System.config({
// DEMO ONLY! REAL CODE SHOULD NOT TRANSPILE IN THE BROWSER
transpiler: 'ts',
typescriptOptions: {
tsconfig: true
},
meta: {
'typescript': {
"exports": "ts"
}
},
paths: {
// paths serve as alias
'npm:': 'https://unpkg.com/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
app: 'app',
// angular bundles
'@angular/core': 'npm:@angular/core@4.2.2/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common@4.2.2/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler@4.2.2/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser@4.2.2/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic@4.2.2/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/http@4.2.2/bundles/http.umd.js',
'@angular/forms': 'npm:@angular/forms@4.2.2/bundles/forms.umd.js',
'ionic-angular': 'npm:ionic-angular@3.4.0',
'rxjs': 'npm:rxjs@5.4.1',
'ts': 'npm:plugin-typescript@5.2.7/lib/plugin.js',
'typescript': 'npm:typescript@2.2.1/lib/typescript.js',
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
main: './main.ts',
defaultExtension: 'ts'
},
rxjs: {
defaultExtension: 'js'
},
'ionic-angular': {
main: './umd/index.js',
defaultExtension: 'js'
}
}
});
})(this);
/*
Copyright 2016 Google Inc. All Rights Reserved.
Use of this source code is governed by an MIT-style license that
can be found in the LICENSE file at http://angular.io/license
*/
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": true,
"suppressImplicitAnyIndexErrors": true
}
}
import {Component} from '@angular/core';
import {NavParams, Platform,ModalController, ViewController, LoadingController} from "ionic-angular";
import {ModalPage} from "./modal-page";
@Component({
selector: 'page-profile',
templateUrl: 'app/profile.html',
})
export class Profile {
reviews=ModalPage;
constructor(public modal:ModalController,public viewCtrl:ViewController) {
}
pushPage(){
let modal = this.modal.create(ModalPage);
modal.present();
}
}
<ion-header>
<ion-navbar>
<ion-title>
Profile App
</ion-title>
<ion-buttons start>
<button ion-button left [menuToggle]="activeMenu">
<ion-icon name="menu"></ion-icon>
</button>
</ion-buttons>
<ion-buttons end>
<button ion-button right (click)="pushPage('reviews')">
Reviews
</button>
</ion-buttons>
</ion-navbar>
</ion-header>
<ion-content padding>
<ion-item>
<div id="pageicon">
<ion-icon name="person"></ion-icon>
</div>
</ion-item>
<ion-item>
<button ion-button full outline (click)="pushPage()" style="color: #FF1493 !important;border-color: #FF1493;">show Modal</button>
</ion-item>
</ion-content>
#profile img {
display: block;
border-radius: 100px;
border: 2px solid #fff;
width: 80px;
height: 80px;
margin: 0px auto 0;
box-shadow: 0px 0px 4px rgba(0, 0, 0, 0.7);
}
#pageicon {
display: block;
border-radius: 100px;
width: 80px;
height: 80px;
margin: 0px auto 0;
background-color: #f4f4f4;
color: #10238e;
}
.pagetext {
display: block;
border-radius: 100px;
width: 80px;
height: 80px;
margin: 0px auto 0;
background-color: #f4f4f4;
color: #ff1493;
font-size:8.5rem;
}
#pageicon ion-icon{
position: absolute;
top: 50%;
left: 50%;
height: 50%;
transform: translate(-50%, -50%);
font-size:6.5rem;
display: block;
}
.scroll-content {
overflow: hidden;
}
#profile-info {
width: 100%;
z-index: 2;
text-align: center;
}
#profile-name {
color: #161616;
font-size: 26px;
}
#profile {
background-color: #D73B19;
}
#profile .item-inner {
border-bottom: none;
}
.flex-start span{
justify-content:flex-start;
}
.button-icon{
padding-right:50px !important;
width: 50px;
}
.sponsor-button{
background-color:#FF1493;
}
.sponsor-button.activated{
background-color:#d4157c;
}
<ion-menu [content]="content" id="menu1" persistent="true">
<ion-content>
<ion-list>
<ion-item id="profile">
<!-- <img img-preloader="https://ionicframework.com/dist/preview-app/www/assets/img/avatar-ts-woody.png"/>-->
<img src="https://ionicframework.com/dist/preview-app/www/assets/img/avatar-ts-woody.png">
<div id="profile-info">
<h3 id="profile-name">
Monsif Mabrouk
</h3>
</div>
</ion-item>
<ion-item class="flex-start">
<button ion-button full clear icon-start menuClose (click)="openPage(Profile)">
<ion-icon name="person" class="button-icon"></ion-icon>
Profile
</button>
</ion-item>
<ion-item class="flex-start">
<button ion-button full clear icon-start menuClose (click)="openPage(cardPage)">
<ion-icon name="card" class="button-icon"></ion-icon>
Payment
</button>
</ion-item>
<ion-item class="flex-start">
<button ion-button full clear icon-start menuClose (click)="console.log('switch')">
<ion-icon name="switch" class="button-icon"></ion-icon>
Switch to Bedowner
</button>
</ion-item>
<ion-item class="flex-start">
<button ion-button full clear icon-start menuClose (click)="openPage(termsPage)">
<ion-icon name="paper" class="button-icon"></ion-icon>
Terms of use
</button>
</ion-item>
<ion-item class="flex-start">
<button ion-button full clear icon-start menuClose (click)="openPage(sponsorPage)">
<ion-icon name="share" class="button-icon"></ion-icon>
Sponsorship
</button>
</ion-item>
<ion-item class="flex-start">
<button ion-button full clear icon-start menuClose (click)="openPage(helpPage)">
<ion-icon name="help" class="button-icon"></ion-icon>
Help
</button>
</ion-item>
</ion-list>
</ion-content>
<ion-footer>
<button color="danger" full ion-button>Disconnect</button>
</ion-footer>
</ion-menu>
<!-- Disable swipe-to-go-back because it's poor UX to combine STGB with side menus -->
<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>
import {Component,ViewChild} from '@angular/core';
import {NavParams, Platform, ViewController, LoadingController,Slides} from "ionic-angular";
@Component({
selector: 'page-modal',
templateUrl: 'app/modal-page.html',
})
export class ModalPage{
constructor(public viewCtrl:ViewController) {
}
dismiss(){
this.viewCtrl.dismiss();
}
}
<ion-header>
<ion-navbar>
<ion-title>
{{content}}
</ion-title>
<ion-buttons start>
<button ion-button (click)="dismiss()">
close
</button>
</ion-buttons>
</ion-navbar>
</ion-header>
<ion-content scroll="false">
<ion-card>
<ion-segment [(ngModel)]="segment">
<ion-segment-button value="today">Today</ion-segment-button>
<ion-segment-button value="issue">Issue Scroll</ion-segment-button>
</ion-segment>
</ion-card>
<div [ngSwitch]="segment">
<div *ngSwitchCase="'today'">
<ion-item>
<ion-thumbnail item-start>
</ion-thumbnail>
<h2>Photos slides goes here</h2>
</ion-item>
</div>
<div *ngSwitchCase="'issue'">
<ion-scroll style="width:100%;height:100%" scrollY="true">
<ion-list scroll="true">
<ion-item>
<ion-thumbnail item-start>
</ion-thumbnail>
<h2>Ruby</h2>
</ion-item>
<ion-item>
<ion-thumbnail item-start>
</ion-thumbnail>
<h2>Oscar</h2>
</ion-item>
</ion-list>
</ion-scroll>
</div>
</div>
</ion-content>