This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'page-home', | |
templateUrl: 'home.html' | |
}) | |
export class HomePage { | |
@ViewChild('placeholder', {read: ViewContainerRef}) container; | |
constructor(public navCtrl: NavController, private resolver: ComponentFactoryResolver) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'page-home', | |
templateUrl: 'home.html' | |
}) | |
export class HomePage { | |
// reference to the ng-template UI element, rendered as ViewContainerRef class | |
@ViewChild('placeholder', {read: ViewContainerRef}) container; | |
constructor(public navCtrl: NavController, private resolver: ComponentFactoryResolver) { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ion-header> | |
<ion-navbar> | |
<ion-title> | |
Ionic Blank | |
</ion-title> | |
</ion-navbar> | |
</ion-header> | |
<ion-content padding> | |
<ng-template class="temp" #placeholder></ng-template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Component({ | |
selector: 'sample', | |
template: '<div class="param">\n' + | |
' {{parameter}}\n' + | |
'</div>' | |
}) | |
export class SampleComponent { | |
// example parameter | |
@Input('param') parameter: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from '@angular/core'; | |
import { IonicPage, NavController, Tabs } from 'ionic-angular'; | |
@IonicPage() | |
@Compnent({ | |
selector: 'custom-component', | |
templateUrl: '<ion-tabs #mainTabs> | |
<ion-tab tabIcon="ios-home-outline">Custom Tab 1</ion-tab> | |
<ion-tab tabIcon="ios-calendar-outline">Custom Tab 2</ion-tab> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as $ from 'jquery'; | |
import { Component } from '@angular/core'; | |
import { IonicPage, NavController } from 'ionic-angular'; | |
@IonicPage() | |
@Compnent({ | |
selector: 'page-animation', | |
templateUrl: 'animation.html' | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// handling app return to foreground | |
[[NSNotificationCenter defaultCenter] | |
addObserver:self selector:@selector(handleReload:) | |
name:UIApplicationWillEnterForegroundNotification | |
object:nil]; | |
-(void) handleReload: (NSNotification *) note { | |
NSLog("foreground again!"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void) restrictRotation:(BOOL) restriction | |
{ | |
AppDelegate* appDelegate = (AppDelegate*)[UIApplication sharedApplication].delegate; | |
appDelegate.restrictRotation = restriction; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(NSUInteger) application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window | |
{ | |
if(self.restrictRotation) | |
return UIInterfaceOrientationMaskPortrait; | |
else | |
return UIInterfaceOrientationMaskAll; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)didDismissWithButtonIndex:(NSInteger)index alertID:(NSString *)alertID{ | |
if ([alertID isEqualToString:@"default"] && index == 1) { | |
NSLog(@"hi"); | |
} | |
if ([alertID isEqualToString:@"default"] && index == 2){ | |
NSLog(@"goodbye"); | |
} | |
} |
NewerOlder