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
getAll(){ | |
return {"results":[{"gender":"female","name":{"title":"miss","first":"آنیتا","last":"نكو نظر"},"location":{"street":"4842 شهید رحمانی","city":"قزوین","state":"گلستان","postcode":88633},"email":"آنیتا.نكونظر@example.com","login":{"username":"beautifulmouse467","password":"prayers","salt":"jCIISMlp","md5":"39762c237b92dd7b8e392669103afdcc","sha1":"1fd5de475c3e607247634fb512e079e143481de3","sha256":"d6945d3a277027ce84afca2fce0a78b32d3f518df0c90fb5c478367a2ae63e4d"},"dob":"1957-12-19 17:41:58","registered":"2002-06-12 01:25:09","phone":"021-59610882","cell":"0947-822-5292","id":{"name":"","value":null},"picture":{"large":"https://randomuser.me/api/portraits/women/17.jpg","medium":"https://randomuser.me/api/portraits/med/women/17.jpg","thumbnail":"https://randomuser.me/api/portraits/thumb/women/17.jpg"},"nat":"IR"},{"gender":"male","name":{"title":"mr","first":"brandão","last":"lopes"},"location":{"street":"6004 rua são pedro ","city":"bragança","state":"santa catarina","postcode":77776},"email":"brand |
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
let loading = this.loadingCtrl.create({ | |
spinner: 'hide', | |
content: ` | |
<div class="custom-spinner-container"> | |
<div class="custom-spinner-box"></div> | |
</div>`, | |
duration: 5000 | |
}); |
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 { TestBed, inject, fakeAsync, tick } from '@angular/core/testing'; | |
import { YourService } from './your.service'; | |
describe('Provider: YourService', () => { | |
//Arrange | |
beforeEach(() => { | |
TestBed.configureTestingModule({ | |
providers: [ | |
{ provide: YourService, useClass: YourService }, |
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
export class YourPage { | |
constructor( | |
... | |
private platform: Platform, | |
) { | |
if(this.platform.is('cordova')){ | |
this.initPush(); | |
} | |
} |
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 ts | |
@Component({ | |
selector: 'your-component', | |
templateUrl: 'your-component.html', | |
}) | |
export class YourComponent { | |
@Input() photo: string; | |
constructor( |
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
getVendedores(){ | |
let vendedores = []; | |
let sizeVendedores = 0; | |
return new Promise((resolve, reject)=>{ | |
this.fireDatabase.list('/supervidores/idSupervidor/VendedoresList') | |
.subscribe(list =>{ | |
sizeVendedores = list.length; | |
list.forEach(vendedor=>{ | |
let imei = vendedor.imei; | |
this.fireDatabase.object('/vendedores/'+imei) |
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
private checkSession(){ | |
if(this.auth.isLoggedIn()){ | |
this.navMaster.setRoot('HomePage'); | |
}else{ | |
this.navMaster.setRoot('LoginPage'); | |
} | |
this.splashScreen.hide(); | |
} |
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
private generateMarkers(latitude:number, longitude: number, limit: number){ | |
let markers: any[] = []; | |
for(let i =0;i<limit;i++){ | |
markers.push({ | |
title: 'hola ' + i, | |
position: { | |
lat: latitude + Math.random() * (1 - (-1)) + (-1), | |
lng: longitude + Math.random() * (1 - (-1)) + (-1) | |
} | |
}); |
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 { Geolocation } from '@ionic-native/geolocation'; | |
... | |
constructor(private geolocation: Geolocation) {} | |
... | |
let watch = this.geolocation.watchPosition(); | |
watch.subscribe((data) => { |
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
apt-get update | |
apt-get install graphviz | |
pip install pygraphviz | |
pip install pyparsing==1.5.7 | |
pip install pydot | |
python manage.py graph_models --pydot -a -g -o {{project}}-dbmodel.png |