v1 Online Demo: https://codesandbox.io/s/v1-angular-numeric-ljwlb
v2 Online Demo: https://codesandbox.io/s/v2-angular-numeric-3w2wr
v1 Online Demo: https://codesandbox.io/s/v1-angular-numeric-ljwlb
v2 Online Demo: https://codesandbox.io/s/v2-angular-numeric-3w2wr
ngOnInit() { | |
this.form = this.fb.group({ | |
'Xs': this.fb.array([ | |
this.initX() | |
]) | |
}); | |
this.form.valueChanges.subscribe(data => this.validateForm()); | |
this.validateForm(); | |
} |
<form [formGroup]="form"> | |
<!-- X --> | |
<div formArrayName="Xs"> | |
<div *ngFor="let X of form['controls'].Xs['controls']; let ix=index"> | |
<div formGroupName="{{ix}}" class="Xs"> | |
<input type="text" formControlName="X"> | |
<p>{{ formErrors.Xs[ix].X }}</p> | |
<!-- Y --> | |
<div formArrayName="Ys"> | |
<div *ngFor="let Y of X['controls'].Ys['controls']; let iy=index"> |
<?php | |
function validaCPF($cpf) { | |
// Extrai somente os números | |
$cpf = preg_replace( '/[^0-9]/is', '', $cpf ); | |
// Verifica se foi informado todos os digitos corretamente | |
if (strlen($cpf) != 11) { | |
return false; |
/* | |
* Handling Errors using async/await | |
* Has to be used inside an async function | |
*/ | |
try { | |
const response = await axios.get('https://your.site/api/v1/bla/ble/bli'); | |
// Success 🎉 | |
console.log(response); | |
} catch (error) { | |
// Error 😨 |
To enable the Storage
facade in Lumen 5.2 you need to modify a few things.
First of all you need to create a filesystems.php
in a config
folder.
The config
folder needs to be at the same level as your app
and bootstrap
folder. If it's not there yet just create it.
import React, { Component } from 'react'; | |
import TextField from 'components/base/TextField'; | |
const WAIT_INTERVAL = 1000; | |
const ENTER_KEY = 13; | |
export default class TextSearch extends Component { | |
constructor(props) { | |
super(); |
<?php | |
//Testa uma faixa de cep | |
function checkCpfRange($valor, $intervalos) { | |
$v = (int) preg_replace("/\D+/", "", $valor); | |
foreach ($intervalos as $range): | |
list($min, $max) = $range; | |
if ($v >= $min && $v <= $max) | |
return true; | |
endforeach; | |
return false; |