Guest User

Untitled

a guest
Oct 23rd, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 KB | None | 0 0
  1. Ionic start appname sidemenu --v2 --ts
  2.  
  3. import {App, IonicApp, Platform,MenuController} from 'ionic-angular';
  4. import {StatusBar} from 'ionic-native';
  5. import {HelloIonicPage} from './pages/hello-ionic/hello-ionic';
  6. import {ListPage} from './pages/list/list';
  7. import {HomePage} from './pages/home/home';
  8.  
  9.  
  10. @App({
  11. templateUrl: 'build/app.html',
  12. config: {} // http://ionicframework.com/docs/v2/api/config/Config/
  13. })
  14. class MyApp {
  15. // make HelloIonicPage the root (or first) page
  16. rootPage: any = HomePage;
  17. pages: Array<{title: string, component: any}>;
  18.  
  19. constructor(
  20. private app: IonicApp,
  21. private platform: Platform,
  22. private menu: MenuController
  23. ) {
  24. this.initializeApp();
  25.  
  26. // set our app's pages
  27. this.pages = [
  28. { title: 'Hello Ionic', component: HelloIonicPage },
  29. { title: 'My First List', component: ListPage }
  30. ];
  31. }
  32.  
  33. initializeApp() {
  34. this.platform.ready().then(() => {
  35. // Okay, so the platform is ready and our plugins are available.
  36. // Here you can do any higher level native things you might need.
  37. StatusBar.styleDefault();
  38. });
  39. }
  40.  
  41. openPage(page) {
  42. // close the menu when clicking a link from the menu
  43. this.menu.close();
  44. // navigate to the new page if it is not the current page
  45. let nav = this.app.getComponent('nav');
  46. nav.setRoot(page.component);
  47. }
  48. }
  49.  
  50. <ion-menu side-menu-content drag-content="false" [content]="content">
  51.  
  52. <ion-toolbar>
  53. <ion-title>Pages</ion-title>
  54. </ion-toolbar>
  55.  
  56. <ion-content>
  57. <ion-list>
  58. <button ion-item *ngFor="#p of pages" (click)="openPage(p)">
  59. {{p.title}}
  60. </button>
  61. </ion-list>
  62. </ion-content>
  63.  
  64. </ion-menu>
  65.  
  66. <ion-nav id="nav" [root]="rootPage" #content swipe-back-enabled="false"></ion-nav>
  67.  
  68. import {Page, Events,Alert,NavController,Loading,Toast,Storage,LocalStorage,SqlStorage} from 'ionic-angular';
  69. import { FORM_DIRECTIVES, FormBuilder, ControlGroup, Validators, AbstractControl } from 'angular2/common';
  70. import {HelloIonicPage} from '../hello-ionic/hello-ionic';
  71. import {NgZone} from 'angular2/core';
  72.  
  73. @Page({
  74. templateUrl: 'build/pages/home/home.html'
  75. })
  76. export class HomePage {
  77.  
  78. public Uname :string;
  79. public usrvalid:boolean;
  80. public usrpwd :boolean;
  81. public usrpwdlength:boolean;
  82. public usrvalidlength:boolean;
  83. public isUnchanged:boolean;
  84. public usrpwdzero:boolean;
  85. public usrvaliddigits:boolean;
  86. rootpage:any;
  87.  
  88. public Upwd:string;
  89. constructor(public nav:NavController) {
  90. this.nav=nav;
  91. this.isUnchanged=true;
  92. var mediumRegex = new RegExp("^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})");
  93.  
  94. // rootPage: any = HomePage;
  95.  
  96. }
  97. }
  98.  
  99. import {Page, MenuController} from 'ionic-angular';
  100.  
  101. @Page({
  102. templateUrl: 'build/pages/home/home.html'
  103. })
  104. export class HomePage {
  105. constructor(public menu: MenuController) {
  106. this.menu.swipeEnable(false);
  107. }
  108. }
  109.  
  110. this.menu.swipeEnable(false, `menuId`);
  111.  
  112. $ionicSideMenuDelegate.canDragContent(false)
Add Comment
Please, Sign In to add comment