What do you want to save?
Add Code snippet
New code examples
-
TypeScript 2022-03-27 17:15:20
angular formgroup mark as touched
// From Angular 8/9 you can simply use this.formGroup.markAllAsTouched(); /** * For version older than Angular 8 * Marks all controls in a form group as touched * @param formGroup - The form group to touch */ private markFormGroupTouched(formGroup:... Add solution -
Java 2022-03-24 17:40:08
java map foreach
Map<String, Integer> items = new HashMap<>(); items.put("A", 10); items.put("B", 20); items.put("C", 30); items.put("D", 40); items.put("E", 50); items.put("F", 60); items.forEach((k... Add solution -
PHP 2022-03-24 01:20:09
how to run foreach for the entire array except for one line in php
There are multiple ways of approaching this problem. The first solution is to use a flag boolean to indicate the first element and proceed in your foreach $firstElement = true; foreach($array as $key => $val) { if($firstElement) { $firstEl... Add solution -
Other 2022-03-22 23:20:11
No me reconoce la variable de conexión a Base de datos
function Productos(){ require_once("conexion.php"); $data = file_get_contents("productos.json"); $producto = json_decode($data, true); foreach($producto as $a){ $consulta = $conn->prepare("Insert into pr... Add solution -
Javascript 2022-03-22 13:20:11
creating room in ws node js
const rooms = {}; wss.on("connection", socket => { const uuid = ...; // create here a uuid for this connection const leave = room => { // not present: do nothing if(! rooms[room][uuid]) return; // if the one exiting is t... Add solution