Angular 2 – Observables

Observables are another way of handling async tasks. Angular2 use them a lot. Usually are objects wrapping some data source which emits events, such as button clicks , https requests, etc. Analyzing a Built in observable We already used observables when subscribing to changes int the route params: this.route.params.subscribe( (params: Params)=> { = +params[‘id’]; […]

Angular 2 – Routing

Setting up and loading routes We set up two routes: http://localhost:4200/page1 http://localhost:4200/page2 app.module.ts import { Routes, RouterModule } from ‘@angular/Router’; import { Page1Component } from ‘./page1/page1.component’; import { Page2Component } from ‘./page2/page2.component’; const appRoutes: Routes = [ // { path: ”, Page1Component}, { path: ‘page1’, component: Page1Component}, { path: ‘page2’, component: Page2Component} ]; … imports: […]

Angular 2 – Using services and dependency injection

Injecting a custom service into components A Service is created when we need a centralized component which serves some functionality to multiple components. Also we would expect to be a singleton instance. app.component.html <button type=”button” (click)=”testLoggingService(‘one’)” name=”button”>Test Logging Service One</button> <button type=”button” (click)=”testLoggingService(‘two’)” name=”button”>Test Logging Service Two</button> app.component.ts import { Component } from ‘@angular/core’; import […]

Angular 2 – Directives Deep dive

Attribute vs Structural Directives In attribute directives you never modify the DOM structure , just change some behaviour in the element where it is added to. I looks like a normal HTML attribute (with databinding or property binding). In Structural directives the DOM is modified. It also looks like a normal HTML attribute but it […]

Angular2 – Introduction Notes

Angular CLI Before install check latest nodejs version (>=v7.7.1) npm install -g @angular/cli Angular Command Line Interface for workflow commons tasks. More info in Create a new app skeleton: ng new my-first-app Init local development server: ng serve Integrating Bootstrap Install bootstrap npm package npm install –save bootstrap Edit .angular-cli.json: “styles”: [ “../node_modules/bootstrap/dist/css/bootstrap.min.css”, “styles.css” ], […]

Ecmascript 6: Modules

[Fuente:] 16.1 Overview JavaScript has had modules for a long time. However, they were implemented via libraries, not built into the language. ES6 is the first time that JavaScript has built-in modules. ES6 modules are stored in files. There is exactly one module per file and one file per module. You have two ways […]


[Fuente:] Sobre React-Leaflet Esta librería proporciona una abstracción de Leaflet en forma de React components. No reemplaza a Leaflet, sólo se basa en los React’s lifecycle methods para invocar los handlers relevantes de Leaflet. Puedes leer más información sobre el proceso del ciclo de vida en How it works. Por favor asegúrate que entiendes todos los core concepts y limitations para evaluar si esta […]

AngularJS: Form validation built in support

[Fuente:] We’ll focus on client side validation and using the built in Angular form properties. Demo See the Pen AngularJS Form Validation by Chris Sevilleja (@sevilayha) on CodePen. Requirements Name is required Username is not required, minimum length 3, maximum length 8 Email is not required, but has to be a valid email Form […]

Picturefill 2.0: Responsive Images And The Perfect Polyfill

[Fuente:] Over the last four years (yeah, it’s been about four years), we’ve seen many permutations of images in responsive design. From the lazier days of setting max-width: 100% (the absolute minimum you should be doing) to more full-featured JavaScript implementations, such as Picturefill and Zurb’sdata-interchange method, we’ve spent a lot of time spinning […]