Skip to content

Instantly share code, notes, and snippets.

View yoelnacho's full-sized avatar
:octocat:
working

Ignacio Arguello yoelnacho

:octocat:
working
View GitHub Profile
@yoelnacho
yoelnacho / pipe.ts
Created July 13, 2017 01:13
variables en un string
path: string = "assets/images/";
let noimage = `${ path }no_avatar.svg`;
// Devuelve -> "assets/images/no_avatar.svg"
@yoelnacho
yoelnacho / moment.pipe.ts
Created July 16, 2017 21:35
moment pipe
import { Pipe, PipeTransform } from '@angular/core';
import moment from 'moment';
@Pipe({
name: 'moment'
})
export class MomentPipe implements PipeTransform {
transform(value: moment.Moment, format: string) {
if (!moment.isMoment(value))
@yoelnacho
yoelnacho / interpolacion.ts
Created August 15, 2017 20:35
TS interpolación variable + string
question.title = `Hello ${this.name}, how old are you?`;
@yoelnacho
yoelnacho / radio.component.html
Last active August 18, 2017 22:38
ionic3: (ionChange)
<ion-list radio-group (ionChange)="userSelected($event)">
<user *ngFor="let user of users"
[data]="user"></user>
</ion-list>
// Dentro de un grupo de radio buttons, al seleccionar alguno de los elementos
@yoelnacho
yoelnacho / readme.md
Created September 14, 2017 15:37
Github Pages

angular-cli-ghpages

readme ghpages.

Install:

npm i -g angular-cli-ghpages

Usage:

@yoelnacho
yoelnacho / iangularfire2 nstall
Last active August 21, 2018 13:12
Problema Promise<> en AngularFire2
npm install angularfire2@next -- save
@yoelnacho
yoelnacho / server.js
Created November 9, 2017 00:50
Create a server.js: javascript file with following code
const http = require('http');
const hostname = '127.0.0.1';
const port = 3000;
const server = http.createServer(function(req, res) {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});
@yoelnacho
yoelnacho / component.html
Created February 21, 2018 13:42
If condition in template
[ngValue]="item.value ? item.value : item"
@yoelnacho
yoelnacho / app.component.html
Last active August 15, 2018 20:55
Material input type=file
<div class="container">
<button md-raised-button color="primary" (click)="fileInput.click()">Upload</button>
<input hidden type="file" #fileInput>
</div>
@yoelnacho
yoelnacho / keybinding.json
Created August 17, 2018 13:54
Vscode Keybindings
[
// duplicar línea abajo
{
"key": "shift+ctrl+d",
"command": "editor.action.copyLinesDownAction",
"when": "editorTextFocus"
}
]