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 { Injectable } from '@angular/core'; | |
import { Product } from '../interfaces/product'; | |
// aqui você substitui pelo angularFire que ta utilizando | |
import * as firebase from 'firebase'; | |
// import do localStorage do angular, tem que instalar essa lib https://www.npmjs.com/package/@ngx-pwa/local-storage | |
import { StorageMap } from '@ngx-pwa/local-storage'; | |
@Injectable({ | |
providedIn: 'root' | |
}) |
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
//função de cadastro de cliente | |
adicionarCliente() { | |
// NÃO FAÇO A MINIMA IDEIA DO QUE FAZ ESSE METODO ABAIXO, MAS SE ALGO APÓS ELE RETORNA UM VALOR NECESSÁRIO PARA CUMPRIR... | |
// ...ESSE METODO DE ADICIONAR CLIENTE, O CERTO SERIA TRANSFORMAR EM PROMISE TAMBÉM. | |
this.cliente.clienteFinalizado = true; | |
this.clienteProvider.adicionarCliente(this.cliente); | |
//faz o upload da foto | |
this.uploadPhoto().then(response => { | |
// após upload concluído, a variável foto recebe a URL da foto no storage |
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, State, Listen, Watch } from "@stencil/core"; | |
@Component({ | |
tag: "todo-list", | |
styleUrl: "todo-list.css" | |
}) | |
export class TodoList { | |
@State() concluidas: number = 0; | |
@State() tarefas: Array<{ feito: boolean; descricao: string }> = []; | |
@State() input: 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, Prop, Event, EventEmitter, State } from '@stencil/core'; | |
@Component({ | |
tag: 'todo-item', | |
styleUrl: "todo-item.css" | |
}) | |
export class TodoItem { | |
@Prop() posicao: number; | |
@Prop() descricao: 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, Prop } from '@stencil/core'; | |
@Component({ | |
tag: 'my-component', | |
styleUrl: 'my-component.css' | |
}) | |
export class MyComponent { | |
@Prop() first: 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
// Todos os imports da sua página e @component | |
// para esse exemplo assumo que você esteja usando formbuilder/formgroup | |
export class suaPagina { | |
// propriedade que vai dizer se o usuário poderá ou não deixar a página | |
podeSair: boolean = false; | |
// CASO O USUARIO QUEIRA SAIR MAS TENHA PREENCHIDO ALGO. | |
ionViewCanLeave() { | |
// se a variavel para sair for falsa e seu formulário está em estado de 'dirty' (algo já foi preenchido) entra na condição | |
if (this.canLeave == false && this.seuForm.dirty) { |
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
// Faça dessa forma na sua pagina do searchbar | |
import { Normalize } from '/path/to/normalize'; | |
export class YourPage { | |
constructor(public norm: Normalize){} | |
filter(ev: any) { | |
// Reset items back to all of the items | |
this.inicializaSeuFiltro(); |
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
// Lazy Loading a component | |
const HomePage = resolve => { | |
require.ensure(['./components/Home/HomePage.vue'], () => { | |
resolve(require('./components/Home/HomePage.vue')); | |
}); | |
}; | |
// Exported routes to be used in main.js | |
export const routes = [ | |
{ |
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
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Data.Entity; | |
using System.Data.Entity.Infrastructure; | |
using System.IO; | |
using System.Linq; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using System.Threading.Tasks; |
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
/* | |
COM O FCM, PRIMEIRO INSTALA O PLUGIN QUE TA NO IONIC NATIVE MESMO https://ionicframework.com/docs/native/fcm/ | |
FAZ COMO TODO PLUGIN, INSTALA O PLUGIN, INSTALA O WRAPPER. | |
DEPOIS COLOCA O PLUGIN NO SEU APP.MODULE: | |
*/ | |
import { FCM } from '@ionic-native/fcm'; | |
@NgModule({ | |
declarations: [ |
NewerOlder