AGENDA
S1
• INTRODUCERE IN ANGULARJS
• CE APLICATIE VOM FACE?
• PREGATIREA MEDIULUI DE LUCRU (environment setup)
• DIRECTIVE (CORE)
AGENDA
S3
• RUTAREA (routing)
• DESPRE REST (REpresentational State Transfer)
• SERVICII (http services and custom services)
PRO
Single Page Application
Data binding capability to HTML
Unit testable
Dependency injection and make use of separation of concerns
Reusable components (directives)
Less code and get more functionality
Views = pure html pages;
Controllers = business logic
SPECIFICATII
1. Lista de taskuri
2. Adaugare de taskuri
3. Editare a taskurilor
4. Stergere a taskurilor
5. Marcarea taskurilor drept completate
SETUP
ANGULAR
Metode de instalare
- Download - https://angularjs.org/
- Bower/NPM
- Yeoman
BOOTSTRAP
Metode de instalare
- Download - http://getbootstrap.com/getting-started
- Bower
ng-if ng-change ng-checked ng-disabled ng-init ng-change ng-dblclick ng-form ng-blur
ng-focus ng-include ng-mousedown ng-mouseup ng-mousenter ng-options ng-
readonly ng-style ng-submit etc.
CORE DIRECTIVES
Representational State Transfer
REST este un tip de architectura ce exploateaza tehnologiile si protocoalele Web existente, inclusiv HTTP
REST
SERVICES interaction
Provides inter- and cross-communication across scopes, services, filters, and other AngularJS artifacts.
Just because a service encapsulates state does not mean you can persist the state there (do a refresh)
$httpBackend service
$httpBackend.whenGET(/^\/tasks\?limit=\d+&offset=\d+/).respond(fetchTasks); $httpBackend.whenGET(/^\/tasks\/\d+/).respond(fetchTask);
$httpBackend.whenPUT(/^\/tasks\/\d+\/done/).respond(completeTask);
$httpBackend.whenPUT(/^\/tasks\/\d+/).respond(updateTask);
$httpBackend.whenPATCH(/^\/tasks\/\d+/).respond(updateTask);
$httpBackend.whenDELETE(/^\/tasks\/\d+/).respond(deleteTask);
$httpBackend.whenPOST(/^\/tasks/).respond(addTask);
$httpBackend.whenGET(/.*/).passThrough();