Skip to content

Instantly share code, notes, and snippets.

View fcampinho's full-sized avatar

Fabio Campinho fcampinho

View GitHub Profile
<PropertyGroup>
<!-- Customize which folders are not shown by default -->
<ExcludedItems>bin;bld;platforms;node_modules;simulation;.git;.vs;.vscode</ExcludedItems>
</PropertyGroup>
<ItemGroup>
<Content Include="**\**" Exclude="**\platforms\**;**\bin\**;**\bld\**;**\node_modules\**;**\simulation\**;.gitignore;allpee.mobile.*;**\.git\**;**\.vs\**;**\.vscode\**" />
</ItemGroup>
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore
*~
*.sw[mnpcod]
*.log
*.tmp
*.tmp.*
log.txt
*.sublime-project
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { HttpModule, Http } from '@angular/http';
export function createTranslateLoader(http: Http) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
@NgModule({
....
import { TranslateService } from '@ngx-translate/core';
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, translate: TranslateService) {
platform.ready().then(() => {
statusBar.styleDefault();
splashScreen.hide();
translate.setDefaultLang('en');
translate.use('en');
});
import { TranslateModule } from '@ngx-translate/core';
@NgModule({
declarations: [HomePage],
imports: [
IonicPageModule.forChild(HomePage),
TranslateModule.forChild()
]
})
export class HomePageModule { }
import { TranslateService } from '@ngx-translate/core';
constructor(public navCtrl: NavController, platform: Platform, translate: TranslateService) {
platform.ready().then(() => {
translate.get('W_TEXT').subscribe(
value => {
// value is our translated string
this.text = value;
}
);
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { IonicStorageModule } from '@ionic/storage';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { MyApp } from './app.component';
@NgModule({
import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
@Component({
templateUrl: 'app.html'
})
export class MyApp {
ion-content {
background-color: #11aaaa !important;
}
ion-title img {
max-height: 35px;
}
button {
border: none !important;
interface Period {
start: Date;
end: Date;
updatePeriod(start: Date, end: Date);
}
export interface TimeTracker extends Period {
id: string;
detail: string;