// Angular 1 const module = angular.module('myModule', []); module.service('UserService', ['$http', function ($http) { this.getUsers = () => { return $http.get('http://api.mywebsite.com/users') .then(res => res.data) .catch(res => new Error(res.data.error)); } }]); /***************************************************************/ // Angular 2 import { Injectable } from '@angular/core'; import { Http, Response } from '@angular/http'; import { Observable } from 'rxjs/Observable'; @Injectable() class UserService { constructor(private http: Http) {} getUsers(): Observable<User[]> { return this.http.get('http://api.mywebsite.com/users') .map((res: Response) => res.json()) .catch((res: Response) => Observable.throw(res.json().error); } }
اشتراکها
کتابخانه angular-cropify
Angular directive to crop/select an area of an element such as an image. Possible lightweight Jcrop alternative. Demo
اشتراکها
کتابخانه AngularUI Bootstrap
Native AngularJS (Angular) directives for Bootstrap. Smaller
footprint (20kB gzipped), no 3rd party JS dependencies (jQuery,
bootstrap JS) required. Demo
اشتراکها
کتابخانه ngEasyImageCrop
Angular Directive for Easy Server-Side Image Cropping. Handles both original image and scaled image dimensions. Demo
Last week, at ng-conf, the Angular team at Google provided the web developer world with an update on the state of Angular 2. They were joined on stage by a member of the TypeScript team, Jonathan Turner, to also announce that Angular 2 will be built using TypeScript. Jonathan then demoed a preview of the upcoming TypeScript 1.5 release via an Angular 2 sample application.