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
{ | |
"estados": [ | |
{ | |
"sigla": "AC", | |
"nome": "Acre", | |
"região": "Norte", | |
"capital": "Rio Branco", | |
"cidades": [ | |
"Acrelândia", | |
"Assis Brasil", |
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 { BrowserModule } from '@angular/platform-browser'; | |
import { NgModule } from '@angular/core'; | |
import { AppComponent } from './app.component'; | |
//Angular Material Components | |
import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; | |
import {MatCheckboxModule} from '@angular/material'; | |
import {MatButtonModule} from '@angular/material'; |
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
var json = [ | |
{ | |
"Year": 2001 | |
}, | |
{ | |
"Year": 2017 | |
}, | |
{ | |
"Year": 1900 | |
}, |
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
function pushToArray(array, descricao, value){ | |
array.push({descricao: value}); | |
} |
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
function isAvailable(param){ | |
if(!param){ | |
return param='Undefined' | |
}else{ | |
return param=param; | |
} | |
} |
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
(focus)="myMethod()" // An element has received focus | |
(blur)="myMethod()" // An element has lost focus | |
(submit)="myMethod()" // A submit button has been pressed | |
(scroll)="myMethod()" | |
(cut)="myMethod()" | |
(copy)="myMethod()" | |
(paste)="myMethod()" |
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
//returns a string | |
convertToLocalTimeToString(hora){ | |
hora = moment.utc(hora); | |
hora = hora.local().format(); | |
return hora; | |
} | |
//returns a moment obj - use to get difference | |
convertToLocalTimeToObj(hora){ | |
hora = moment.utc(hora); |
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 { Pipe, PipeTransform } from '@angular/core'; | |
import * as moment from 'moment'; | |
//insert your locale | |
moment.locale('pt-br'); | |
@Pipe({ | |
name: 'timeago', | |
}) | |
export class TimeagoPipe implements PipeTransform { | |
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
Minimum eight characters, at least one letter and one number: | |
"^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$" | |
Minimum eight characters, at least one letter, one number and one special character: | |
"^(?=.*[A-Za-z])(?=.*\d)(?=.*[$@$!%*#?&])[A-Za-z\d$@$!%*#?&]{8,}$" | |
Minimum eight characters, at least one uppercase letter, one lowercase letter and one number: | |
"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,}$" | |
Minimum eight characters, at least one uppercase letter, one lowercase letter, one number and one special character: |
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
"AANA", | |
"AANTONIO", | |
"AARAO", | |
"AARON", | |
"ABADIA", | |
"ABADIO", | |
"ABDA", | |
"ABDALA", | |
"ABDIAS", | |
"ABDIEL", |
OlderNewer