Skip to content

Instantly share code, notes, and snippets.

View saniyusuf's full-sized avatar
🏠
Working from home

Sani Yusuf saniyusuf

🏠
Working from home
View GitHub Profile
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
...
"configurations": {
"production": { ... },
"staging": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.staging.ts"
}
]
}
<input
type="text"
(keypress)="onKeyboardEvent($event)">
onKeyboardEvent(evt: KeyboardEvent) {
const charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)) {
return false;
}
@saniyusuf
saniyusuf / ionViewCanEnter()
Last active December 7, 2016 01:11
Sample Code Usage For ionViewCanEnter() Ionic Page Lifecycle Function
ionViewCanEnter(): boolean {
if(userIsLoggedIn){
return true;
} else {
return false;
}
}
<ion-card *ngFor="let track of tracks">
<img [src]="track.album.images[0].url"/>
<ion-card-content>
<ion-card-title>
{{track.name}}
</ion-card-title>
<ion-row>
<ion-col center>
<ion-icon primary name="musical-notes">
</ion-icon>
<ion-card *ngFor="let track of tracks">
<img [src]="track.album.images[0].url"/>
<ion-card-content>
<ion-card-title>
{{track.name}}
</ion-card-title>
<ion-row>
<ion-col center>
<ion-icon primary name="musical-notes">
</ion-icon>
<ion-card>
<ion-card-header>
{{movie.Title}}
</ion-card-header>
<ion-card-content>
{{movie.Plot}}
</ion-card-content>
<ion-card-header>
Details
[
{
"Title": "Avatar",
"Year": "2009",
"Rated": "PG-13",
"Released": "18 Dec 2009",
"Runtime": "162 min",
"Genre": "Action, Adventure, Fantasy",
"Director": "James Cameron",
"Writer": "James Cameron",