SlideShare una empresa de Scribd logo
1 de 34
Descargar para leer sin conexión
Introducción a AngularJs
Joan Pablo Jiménez M.
• ¿Qué es AngularJs?
• ¿Qué hace a AngularJs tan especial?
• ¿Quiénes usan AngularJs?
• Angular 2.0
• Preguntas
Agenda
¿Qué no es AngularJs?
AngularJs…
• No es una plataforma (ej: .NET, Java) o un lenguaje (ej: C#).
• No es una librería JavaScript para manipular DOM (ej: jQuery).
• No es una librería de controles visuales de front-end.
• No te abstrae de HTML, CSS o JavaScript.
• No es realmente tan complicado.
¿Qué es AngularJs?
¿Qué es AngularJs?
- Framework JavaScript open-source creado por
Google para desarrollar Aplicaciones Web para
entornos móviles y de escritorio.
- Solo se requieren HTML, CSS y JavaScript en el
cliente.
- En vez de usar ASP.NET MVC, PHP, JSP, Ruby on Rails
para el desarrollo web, puedes construir
enteramente tu aplicación web usando AngularJs.
I often say that Angular is
what the web browser would
have been, had it been designed
for application
Misko Hevery. The Creator.
¿Qué es AngularJs?
“
”
¿Qué hace a AngularJs tan especial?
View
ControllerModel
View :
• Renders the Model data
• Send User actions/events to controller
• UI
1. Event or User Action
or View Load
2. Maps to particular Model
after fetching the data
3. Implement the
Business Logic on
response data and
Bind it to View
Controller:
• Define Application Behavior
• Maps user actions to Model
• Select view for response
Model:
• Business Logic
• Notify view changes
• Application Functionality
• Data in general
Patrón MVC
<ul ng-controller="TweetsController">
<li ng-repeat="tweet in tweets">
{{tweet.body}}
</li>
</ul>
angular.module 'tweetsModule'
.controller 'TweetsController', ($scope, TweetsService)->
$scope.tweets = TweetsService.search 'angularJS'
HTML View
Coffee Script
Two way Data Binding
View
Model
Cambios a la Vista
Actualizan el Modelo
Cambios al Modelo
Actualizan la Vista Actualización Continua
Inyección de Dependencias
El inyector de Angular se encarga
de instanciar un componente,
resolver sus dependencias y
suministrarlo a otro componente
que lo requiera.
.controller 'TweetsController', ($scope, TweetsService)->
$scope.tweets = TweetsService.search 'angularJS'
Inyección de Dependencias
.factory 'TweetsService', ($http)->
{
search: (textQuery)->
$http.get('http://search.twitter.com/search.json?q=' + textQuery)
}
.controller 'TweetsController', ($scope, TweetsService)->
$scope.tweets = TweetsService.search 'angularJs'
Las dependencias se inyectan como parámetros del constructor.
Módulos
Un módulo agrupa diferentes partes de la aplicación:
controladores, servicios, directivas, filtros, etc.
• El código se puede empaquetar como código
reusable.
• Se cargan en cualquier orden.
• Las pruebas de unidad solo cargan los módulos
requeridos.
Servicios
Son la manera de organizar y reusar el código a
través de tu aplicación.
Instanciación Lazy
Singletons
.factory 'TweetsService', ($http)->
{
search: (textQuery)->
$http.get('http://search.twitter.com/search.json?q=' + textQuery)
}
Directivas
Son marcas sobre un elemento del DOM (en forma
de atributo, nombre de elemento, comentario o clase
CSS) que indican a AngularJs que adjunte un
comportamiento específico a ese elemento o incluso
que modifique el DOM del elemento y sus hijos.
Permiten extender el HTML declarativamente
Directivas
<span ng-if="checked">
Removed when the checkbox is unchecked.
</span>
<input type="text" ng-model="user.name">
<ul ng-controller="TweetsController">
<li ng-repeat="tweet in tweets">
{{tweet.body}}
</li>
</ul>
Directivas
<span draggable>DRAG ME</span>
Filtros
Un filtro formatea el resultado de una expresión para
presentarla al usuario. Pueden ser usados en las
vistas, los controladores, servicios y directivas.
Es muy fácil definir tu propio filtro.
{{ expression | filter }}
Filtros
{{ amount | currency }}
{{ createdDate | date }}
{{ weigth | number }}
{{ lowercaseExp | lowercase }}
{{ tweets | filter:queryText }}
Routing
Angular es perfecto para construir aplicaciones SPA
(Single Page Appliaction).
$routProvider
.when '/login', {
templateUrl: 'views/login.html'
controller: 'LoginCtrl'
}
.when '/home', {
templateUrl: 'views/home.html'
controller: 'HomeCtrl'
Angular-UI-Router
Es un módulo de ruteo de AngularJs que organiza la
aplicación alrededor de estados a los que se asocia
una o varias vistas y una URL.
Permite tener en una misma plantilla, múltiples vistas,
vistas anidadas o establecer jerarquía de vistas
potenciando el ruteo de angular.
Testing
Unit Testing
Unit Testing
 Describe tus pruebas con Jasmine, Mocha, Qunit.
 Prueba el código en navegadores reales o en
navegadores headless como PhantomJS.
E2E/Integration Testing
 Test Like a User
 For AngularJS Apps
Aplicaciones basadas en Angularjs
Goodfilms
DoubleClick
Youtube on PS3
Angular Material
 TypeScript
 Web Components (Shadow DOM)
 Nuevo Ruteo
 Performance Mejorado
¿Preguntas?

Más contenido relacionado

La actualidad más candente

The InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQLThe InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQLMorgan Tocker
 
PRIMERA PRESENTACION JAVA
PRIMERA PRESENTACION JAVAPRIMERA PRESENTACION JAVA
PRIMERA PRESENTACION JAVANoralma Yanez
 
Ppt dbsec-oow2013-avdf
Ppt dbsec-oow2013-avdfPpt dbsec-oow2013-avdf
Ppt dbsec-oow2013-avdfMelody Liu
 
Profiling the ACPICA Namespace and Event Handing
Profiling the ACPICA Namespace and Event HandingProfiling the ACPICA Namespace and Event Handing
Profiling the ACPICA Namespace and Event HandingSUSE Labs Taipei
 
INYECCION SQL(SEGURIDAD DE LA INFORMACION)
INYECCION SQL(SEGURIDAD DE LA INFORMACION)INYECCION SQL(SEGURIDAD DE LA INFORMACION)
INYECCION SQL(SEGURIDAD DE LA INFORMACION)toshko86
 
QEMU and Raspberry Pi. Instant Embedded Development
QEMU and Raspberry Pi. Instant Embedded DevelopmentQEMU and Raspberry Pi. Instant Embedded Development
QEMU and Raspberry Pi. Instant Embedded DevelopmentGlobalLogic Ukraine
 
Understanding SQL Trace, TKPROF and Execution Plan for beginners
Understanding SQL Trace, TKPROF and Execution Plan for beginnersUnderstanding SQL Trace, TKPROF and Execution Plan for beginners
Understanding SQL Trace, TKPROF and Execution Plan for beginnersCarlos Sierra
 
Linux Kernel Crashdump
Linux Kernel CrashdumpLinux Kernel Crashdump
Linux Kernel CrashdumpMarian Marinov
 
Windows guest debugging presentation from KVM Forum 2012
Windows guest debugging presentation from KVM Forum 2012Windows guest debugging presentation from KVM Forum 2012
Windows guest debugging presentation from KVM Forum 2012Yan Vugenfirer
 
Afinamiento y entendimiento Garbage Collector JVM IBM
Afinamiento y entendimiento Garbage Collector JVM IBMAfinamiento y entendimiento Garbage Collector JVM IBM
Afinamiento y entendimiento Garbage Collector JVM IBMJuan Camilo Parra
 
database management system lab files
database management system lab filesdatabase management system lab files
database management system lab filesNitesh Dubey
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedureDhaval Kaneria
 
Ingeniería del Software de Gestión. Tema 4
Ingeniería del Software de Gestión. Tema 4Ingeniería del Software de Gestión. Tema 4
Ingeniería del Software de Gestión. Tema 4Enrique Barreiro
 
Unveiling EMUX - ARM and MIPS IoT Emulation Framework
Unveiling EMUX - ARM and MIPS IoT Emulation FrameworkUnveiling EMUX - ARM and MIPS IoT Emulation Framework
Unveiling EMUX - ARM and MIPS IoT Emulation FrameworkSaumil Shah
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugginglibfetion
 
Gti f-007 formato-documento_de_arquitectura (1)
Gti f-007 formato-documento_de_arquitectura (1)Gti f-007 formato-documento_de_arquitectura (1)
Gti f-007 formato-documento_de_arquitectura (1)José Luis
 
Sql server troubleshooting
Sql server troubleshootingSql server troubleshooting
Sql server troubleshootingNathan Winters
 

La actualidad más candente (20)

The InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQLThe InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQL
 
PRIMERA PRESENTACION JAVA
PRIMERA PRESENTACION JAVAPRIMERA PRESENTACION JAVA
PRIMERA PRESENTACION JAVA
 
Ppt dbsec-oow2013-avdf
Ppt dbsec-oow2013-avdfPpt dbsec-oow2013-avdf
Ppt dbsec-oow2013-avdf
 
Profiling the ACPICA Namespace and Event Handing
Profiling the ACPICA Namespace and Event HandingProfiling the ACPICA Namespace and Event Handing
Profiling the ACPICA Namespace and Event Handing
 
INYECCION SQL(SEGURIDAD DE LA INFORMACION)
INYECCION SQL(SEGURIDAD DE LA INFORMACION)INYECCION SQL(SEGURIDAD DE LA INFORMACION)
INYECCION SQL(SEGURIDAD DE LA INFORMACION)
 
QEMU and Raspberry Pi. Instant Embedded Development
QEMU and Raspberry Pi. Instant Embedded DevelopmentQEMU and Raspberry Pi. Instant Embedded Development
QEMU and Raspberry Pi. Instant Embedded Development
 
Character Drivers
Character DriversCharacter Drivers
Character Drivers
 
Understanding SQL Trace, TKPROF and Execution Plan for beginners
Understanding SQL Trace, TKPROF and Execution Plan for beginnersUnderstanding SQL Trace, TKPROF and Execution Plan for beginners
Understanding SQL Trace, TKPROF and Execution Plan for beginners
 
Linux Kernel Crashdump
Linux Kernel CrashdumpLinux Kernel Crashdump
Linux Kernel Crashdump
 
Windows guest debugging presentation from KVM Forum 2012
Windows guest debugging presentation from KVM Forum 2012Windows guest debugging presentation from KVM Forum 2012
Windows guest debugging presentation from KVM Forum 2012
 
Afinamiento y entendimiento Garbage Collector JVM IBM
Afinamiento y entendimiento Garbage Collector JVM IBMAfinamiento y entendimiento Garbage Collector JVM IBM
Afinamiento y entendimiento Garbage Collector JVM IBM
 
database management system lab files
database management system lab filesdatabase management system lab files
database management system lab files
 
Linux booting procedure
Linux booting procedureLinux booting procedure
Linux booting procedure
 
Ingeniería del Software de Gestión. Tema 4
Ingeniería del Software de Gestión. Tema 4Ingeniería del Software de Gestión. Tema 4
Ingeniería del Software de Gestión. Tema 4
 
Unveiling EMUX - ARM and MIPS IoT Emulation Framework
Unveiling EMUX - ARM and MIPS IoT Emulation FrameworkUnveiling EMUX - ARM and MIPS IoT Emulation Framework
Unveiling EMUX - ARM and MIPS IoT Emulation Framework
 
Using AWR for IO Subsystem Analysis
Using AWR for IO Subsystem AnalysisUsing AWR for IO Subsystem Analysis
Using AWR for IO Subsystem Analysis
 
Linux kernel debugging
Linux kernel debuggingLinux kernel debugging
Linux kernel debugging
 
Gti f-007 formato-documento_de_arquitectura (1)
Gti f-007 formato-documento_de_arquitectura (1)Gti f-007 formato-documento_de_arquitectura (1)
Gti f-007 formato-documento_de_arquitectura (1)
 
MySQL 5.7 + JSON
MySQL 5.7 + JSONMySQL 5.7 + JSON
MySQL 5.7 + JSON
 
Sql server troubleshooting
Sql server troubleshootingSql server troubleshooting
Sql server troubleshooting
 

Destacado (9)

Taller de Angular JS: La solución tecnológica perfecta
Taller de Angular JS: La solución tecnológica perfectaTaller de Angular JS: La solución tecnológica perfecta
Taller de Angular JS: La solución tecnológica perfecta
 
Introducción a Angular JS
Introducción a Angular JSIntroducción a Angular JS
Introducción a Angular JS
 
6.angular js
6.angular js6.angular js
6.angular js
 
Introduccion a AngularJS
Introduccion a AngularJSIntroduccion a AngularJS
Introduccion a AngularJS
 
Angular js Frontenders Valencia
Angular js Frontenders ValenciaAngular js Frontenders Valencia
Angular js Frontenders Valencia
 
08 desarrollo de aplicaciones web con angular js dom
08 desarrollo de aplicaciones web con angular js   dom08 desarrollo de aplicaciones web con angular js   dom
08 desarrollo de aplicaciones web con angular js dom
 
Introducción a AngularJS
Introducción a AngularJSIntroducción a AngularJS
Introducción a AngularJS
 
Angular js
Angular jsAngular js
Angular js
 
Curso Básico de AngularJS
Curso Básico de AngularJSCurso Básico de AngularJS
Curso Básico de AngularJS
 

Similar a Angular js

Ruby On Rails Intro
Ruby On Rails IntroRuby On Rails Intro
Ruby On Rails IntroThirdWay
 
Introducción a ASP.NET MVC
Introducción a ASP.NET MVCIntroducción a ASP.NET MVC
Introducción a ASP.NET MVCSebastián Rocco
 
Jsf Java Server Faces
Jsf   Java Server FacesJsf   Java Server Faces
Jsf Java Server Facescok12v
 
003-Introduccion-Angular.pdf
003-Introduccion-Angular.pdf003-Introduccion-Angular.pdf
003-Introduccion-Angular.pdfDubiWeb.TK
 
Despegar Tech Talk - AngularJS
Despegar Tech Talk - AngularJSDespegar Tech Talk - AngularJS
Despegar Tech Talk - AngularJSFacundo Viale
 
Creando Aplicaciones Web en el 2015
 Creando Aplicaciones Web en el 2015 Creando Aplicaciones Web en el 2015
Creando Aplicaciones Web en el 2015Globant
 
Introducciòn a AngularJS
Introducciòn a AngularJSIntroducciòn a AngularJS
Introducciòn a AngularJSRené Olivo
 
Desarrollo de aplicaciones multiplataforma 2/2
Desarrollo de aplicaciones multiplataforma 2/2Desarrollo de aplicaciones multiplataforma 2/2
Desarrollo de aplicaciones multiplataforma 2/2Ignacio Muñoz Vicente
 
Carrera de fondo - La continuada lucha de AngularJS - CodeMotion 2015
Carrera de fondo - La continuada lucha de AngularJS - CodeMotion 2015Carrera de fondo - La continuada lucha de AngularJS - CodeMotion 2015
Carrera de fondo - La continuada lucha de AngularJS - CodeMotion 2015José Manuel García García
 

Similar a Angular js (20)

Introducción a AngularJS
Introducción a AngularJSIntroducción a AngularJS
Introducción a AngularJS
 
Rails intro
Rails introRails intro
Rails intro
 
Angular Fundamentals
Angular FundamentalsAngular Fundamentals
Angular Fundamentals
 
ASP.NET MVC
ASP.NET MVCASP.NET MVC
ASP.NET MVC
 
Ruby On Rails Intro
Ruby On Rails IntroRuby On Rails Intro
Ruby On Rails Intro
 
Introducción a ASP.NET MVC
Introducción a ASP.NET MVCIntroducción a ASP.NET MVC
Introducción a ASP.NET MVC
 
Jsf Java Server Faces
Jsf   Java Server FacesJsf   Java Server Faces
Jsf Java Server Faces
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
Spring Mvc Final
Spring Mvc FinalSpring Mvc Final
Spring Mvc Final
 
003-Introduccion-Angular.pdf
003-Introduccion-Angular.pdf003-Introduccion-Angular.pdf
003-Introduccion-Angular.pdf
 
Integrando AngularJS y drupal
Integrando AngularJS y drupalIntegrando AngularJS y drupal
Integrando AngularJS y drupal
 
Herramientas Digitales
Herramientas DigitalesHerramientas Digitales
Herramientas Digitales
 
Despegar Tech Talk - AngularJS
Despegar Tech Talk - AngularJSDespegar Tech Talk - AngularJS
Despegar Tech Talk - AngularJS
 
Creando Aplicaciones Web en el 2015
 Creando Aplicaciones Web en el 2015 Creando Aplicaciones Web en el 2015
Creando Aplicaciones Web en el 2015
 
Introducciòn a AngularJS
Introducciòn a AngularJSIntroducciòn a AngularJS
Introducciòn a AngularJS
 
Desarrollo de aplicaciones multiplataforma 2/2
Desarrollo de aplicaciones multiplataforma 2/2Desarrollo de aplicaciones multiplataforma 2/2
Desarrollo de aplicaciones multiplataforma 2/2
 
Carrera de fondo - La continuada lucha de AngularJS - CodeMotion 2015
Carrera de fondo - La continuada lucha de AngularJS - CodeMotion 2015Carrera de fondo - La continuada lucha de AngularJS - CodeMotion 2015
Carrera de fondo - La continuada lucha de AngularJS - CodeMotion 2015
 
Angular js in mobile
Angular js in mobileAngular js in mobile
Angular js in mobile
 
[Code Camp 2009] Desarrollando sitios web escalables con ASP.NET MVC (Rodolfo...
[Code Camp 2009] Desarrollando sitios web escalables con ASP.NET MVC (Rodolfo...[Code Camp 2009] Desarrollando sitios web escalables con ASP.NET MVC (Rodolfo...
[Code Camp 2009] Desarrollando sitios web escalables con ASP.NET MVC (Rodolfo...
 
Javascript + Angular Sesion 3
Javascript + Angular Sesion 3Javascript + Angular Sesion 3
Javascript + Angular Sesion 3
 

Angular js

  • 1. Introducción a AngularJs Joan Pablo Jiménez M.
  • 2. • ¿Qué es AngularJs? • ¿Qué hace a AngularJs tan especial? • ¿Quiénes usan AngularJs? • Angular 2.0 • Preguntas Agenda
  • 3. ¿Qué no es AngularJs?
  • 4. AngularJs… • No es una plataforma (ej: .NET, Java) o un lenguaje (ej: C#). • No es una librería JavaScript para manipular DOM (ej: jQuery). • No es una librería de controles visuales de front-end. • No te abstrae de HTML, CSS o JavaScript. • No es realmente tan complicado.
  • 6. ¿Qué es AngularJs? - Framework JavaScript open-source creado por Google para desarrollar Aplicaciones Web para entornos móviles y de escritorio. - Solo se requieren HTML, CSS y JavaScript en el cliente. - En vez de usar ASP.NET MVC, PHP, JSP, Ruby on Rails para el desarrollo web, puedes construir enteramente tu aplicación web usando AngularJs.
  • 7. I often say that Angular is what the web browser would have been, had it been designed for application Misko Hevery. The Creator. ¿Qué es AngularJs? “ ”
  • 8. ¿Qué hace a AngularJs tan especial?
  • 9.
  • 10. View ControllerModel View : • Renders the Model data • Send User actions/events to controller • UI 1. Event or User Action or View Load 2. Maps to particular Model after fetching the data 3. Implement the Business Logic on response data and Bind it to View Controller: • Define Application Behavior • Maps user actions to Model • Select view for response Model: • Business Logic • Notify view changes • Application Functionality • Data in general Patrón MVC
  • 11. <ul ng-controller="TweetsController"> <li ng-repeat="tweet in tweets"> {{tweet.body}} </li> </ul> angular.module 'tweetsModule' .controller 'TweetsController', ($scope, TweetsService)-> $scope.tweets = TweetsService.search 'angularJS' HTML View Coffee Script
  • 12. Two way Data Binding View Model Cambios a la Vista Actualizan el Modelo Cambios al Modelo Actualizan la Vista Actualización Continua
  • 13. Inyección de Dependencias El inyector de Angular se encarga de instanciar un componente, resolver sus dependencias y suministrarlo a otro componente que lo requiera. .controller 'TweetsController', ($scope, TweetsService)-> $scope.tweets = TweetsService.search 'angularJS'
  • 14. Inyección de Dependencias .factory 'TweetsService', ($http)-> { search: (textQuery)-> $http.get('http://search.twitter.com/search.json?q=' + textQuery) } .controller 'TweetsController', ($scope, TweetsService)-> $scope.tweets = TweetsService.search 'angularJs' Las dependencias se inyectan como parámetros del constructor.
  • 15. Módulos Un módulo agrupa diferentes partes de la aplicación: controladores, servicios, directivas, filtros, etc. • El código se puede empaquetar como código reusable. • Se cargan en cualquier orden. • Las pruebas de unidad solo cargan los módulos requeridos.
  • 16. Servicios Son la manera de organizar y reusar el código a través de tu aplicación. Instanciación Lazy Singletons .factory 'TweetsService', ($http)-> { search: (textQuery)-> $http.get('http://search.twitter.com/search.json?q=' + textQuery) }
  • 17. Directivas Son marcas sobre un elemento del DOM (en forma de atributo, nombre de elemento, comentario o clase CSS) que indican a AngularJs que adjunte un comportamiento específico a ese elemento o incluso que modifique el DOM del elemento y sus hijos. Permiten extender el HTML declarativamente
  • 18. Directivas <span ng-if="checked"> Removed when the checkbox is unchecked. </span> <input type="text" ng-model="user.name"> <ul ng-controller="TweetsController"> <li ng-repeat="tweet in tweets"> {{tweet.body}} </li> </ul>
  • 20. Filtros Un filtro formatea el resultado de una expresión para presentarla al usuario. Pueden ser usados en las vistas, los controladores, servicios y directivas. Es muy fácil definir tu propio filtro. {{ expression | filter }}
  • 21. Filtros {{ amount | currency }} {{ createdDate | date }} {{ weigth | number }} {{ lowercaseExp | lowercase }} {{ tweets | filter:queryText }}
  • 22. Routing Angular es perfecto para construir aplicaciones SPA (Single Page Appliaction). $routProvider .when '/login', { templateUrl: 'views/login.html' controller: 'LoginCtrl' } .when '/home', { templateUrl: 'views/home.html' controller: 'HomeCtrl'
  • 23. Angular-UI-Router Es un módulo de ruteo de AngularJs que organiza la aplicación alrededor de estados a los que se asocia una o varias vistas y una URL. Permite tener en una misma plantilla, múltiples vistas, vistas anidadas o establecer jerarquía de vistas potenciando el ruteo de angular.
  • 25. Unit Testing Unit Testing  Describe tus pruebas con Jasmine, Mocha, Qunit.  Prueba el código en navegadores reales o en navegadores headless como PhantomJS.
  • 26. E2E/Integration Testing  Test Like a User  For AngularJS Apps
  • 32.
  • 33.  TypeScript  Web Components (Shadow DOM)  Nuevo Ruteo  Performance Mejorado