Skip to content

Instantly share code, notes, and snippets.

View Sampath-Lokuge's full-sized avatar
🏠
Working from home

Sampath Lokuge Sampath-Lokuge

🏠
Working from home
View GitHub Profile
@Sampath-Lokuge
Sampath-Lokuge / main.dart
Last active June 30, 2022 15:51
My first dart code
void main() {
const vicki = User(id: 24, name: 'Vicki');
print(vicki.id);
}
class User {
final int id;
final String name;
@Sampath-Lokuge
Sampath-Lokuge / translate.ts
Created June 7, 2020 17:44
Apply param with the translate service and array of strings
setPayPal(): void {
forkJoin([this.translateService.get(['Client.Pay-With-PayPal', 'Client.Pay-Now']),
this.translateService.get('Client.Please-Click-And-Make-The-Payment', { value: environment.parcelDeliveryCost })])
.subscribe(([res1, res2]) => {
this.payPal = {
title: res1['Client.Pay-With-PayPal'],
payPalUrl: environment.payPalUrl,
description: res2,
parentButtonText: res1['Client.Pay-With-PayPal'],
@Sampath-Lokuge
Sampath-Lokuge / tslint.json
Last active November 22, 2019 18:14
tslint.json
{
"extends": "tslint:recommended",
"rulesDirectory": [
"codelyzer"
],
"rules": {
"array-type": false,
"arrow-parens": false,
"deprecation": {
"severity": "warn"
.color-white {
color: white !important;
}
.background-transparent {
background: transparent !important;
}
.width-85-percent {
@Sampath-Lokuge
Sampath-Lokuge / user-profile.ts
Created February 25, 2019 19:55
user-profile
export interface UserProfile {
id: string;
name: string;
email: string;
creationTime: any;
}
import { Injectable } from '@angular/core';
import { AngularFirestore, AngularFirestoreDocument } from '@angular/fire/firestore';
import { AngularFireAuth } from '@angular/fire/auth';
import { ShowToastService } from './show-toast.service';
import * as firebase from 'firebase/app';
import { UserProfile } from '../models/user-profile';
import { Facebook } from '@ionic-native/facebook/ngx';
import { Observable } from 'rxjs';
import { first } from 'rxjs/operators';
import { GooglePlus } from '@ionic-native/google-plus/ngx';
import { Injectable } from '@angular/core';
import { ToastController } from '@ionic/angular';
@Injectable({
providedIn: 'root'
})
export class ShowToastService {
constructor(private toastCtrl: ToastController) { }
import { Injectable } from '@angular/core';
import { LoadingController } from '@ionic/angular';
@Injectable({
providedIn: 'root'
})
export class LoadingService {
constructor(private loadingCtrl: LoadingController) { }
<ion-content class="sign-in">
<ion-grid>
<ion-row>
<ion-col size="12" text-center class="color-white">
<h5>Loyalty</h5>
</ion-col>
</ion-row>
<ion-row>
<ion-col size="12" class="color-white" text-center>
<h6>Log in to your account</h6>
import { Component, OnInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { NavController } from '@ionic/angular';
import { ShowToastService } from 'src/app/services/show-toast.service';
import { LoadingService } from 'src/app/services/loading.service';
import { AuthenticationService } from 'src/app/services/authentication.service';
@Component({
selector: 'app-login',
templateUrl: './login.page.html',