REST – Tutorial AngularJS Crashkurs

  • REST steht für Representational state transfer
  • Via HTTP wird über Methoden wie GET, POST, PUT, DELETE usw. zugegriffen
  • REST zeichnet sich aus für:
    • Einfachheit der Interface
    • Modifizierbarkeit der Komponenten sogar während der Laufzeit
    • Sichtbarkeit der Komponenten und des Anbieters der Services
    • Portierbarkeit
    • Verlässlichkeit
  • AngularJS stellt den Service $resource zur Kommunikation mit RESTful backends zur Verfügung und muss über angular-resource.js eingebunden werden
  • REST arbeitet Hand in Hand mit dem JSON-Format zusammen
  • ngMockE2E ermöglicht es eine REST-Attrappe ohne echte Kommunikation zu einen Server aufzubauen und muss über angular-mocks.js eingebunden werden
  • Zur besseren Handhabung von Rest-Client die Advanced Rest Client App installieren unter: https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo oder aber zu Googeln unter: crome extensions restclient
  • Der RestClient kann aufgerufen werden mit: chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo/RestClient.html

index.html

<!DOCTYPE html>
<html>
<script src=„lib/angular.js“></script>
<script src=„lib/angular-resource.js“></script>
<head lang=„en“>
<meta charset=„UTF-8“>
<title>REST</title>
</head>

<body>
<div ng-app=„myApp“ ng-controller=myCtrl>
<table>
<tr ng-repeat=data in pages>
<td>{{data.page}}</td>
</tr>
</table>
</div>

<script>
var app=angular.module(‚myApp‘,[’ngResource‘]);

app.controller(‚myCtrl‘, function($scope, $http, $resource, $log) {

$http({
method: ‚GET‘,
url: ‚http://localhost:3000‘,

}).then(function successCallback(response) {
$scope.pages = response.data;
$log.debug(response);

}, function errorCallback(response) {
alert(‚Error‘);
$log.debug(response);
});
});
</script>

</body>

</html>

server.js

var express=require(‚express‘);
var mongoose=require(‚mongoose‘);
var cors=require(‚cors‘);

mongoose.connect(‚mongodb://localhost/pages‘);

var PageSchema={
page: String
};

var Page=mongoose.model(‚Page‘,PageSchema);
var app=express();

app.use(cors());

app.get(‚/‘,function(req,res){
console.log(‚Get Data‘);
Page.find(function(err,data){
res.send(data);
});
});

app.listen(3000);
console.log(‚Running‘);

Download and Watch Full Movie Fifty Shades Darker (2017)

Streaming Movie Fifty Shades Darker (2017)
  • Fifty Shades Darker (2017)

  • Duration
    118 mins
    Genre
    Drama, Romance.
  • In Cinemas
    February 8, 2017
    Language
    English.
  • Country
    United States of America.
  • Download and Watch Full Movie Fifty Shades Darker (2017)

Plot For Fifty Shades Darker

Movie ‚Fifty Shades Darker‘ was released in February 8, 2017 in genre Drama. James Foley was directed this movie and starring by Dakota Johnson. This movie tell story about When a wounded Christian Grey tries to entice a cautious Ana Steele back into his life, she demands a new arrangement before she will give him another chance. As the two begin to build trust and find stability, shadowy figures from Christian’s past start to circle the couple, determined to destroy their hopes for a future together.

DIRECTOR

James Foley.

Producer

Dana Brunetti, Michael De Luca, E.L. James, Marcus Viscidi.

Production Company

Universal Pictures, Perfect World Pictures (Beijing).

Incoming search term :

Fifty Shades Darker 2017 Watch Online, download full film Fifty Shades Darker, movie Fifty Shades Darker 2017 streaming, Watch Fifty Shades Darker 2017 Online Free Viooz, watch film Fifty Shades Darker 2017 now, Watch Fifty Shades Darker 2017 Online Free hulu, watch full Fifty Shades Darker 2017 movie, Watch Fifty Shades Darker 2017 Online Free Putlocker, Fifty Shades Darker 2017 film download, Watch Fifty Shades Darker 2017 Online 123movies, streaming movie Fifty Shades Darker 2017, download movie Fifty Shades Darker now, download Fifty Shades Darker 2017 movie, watch Fifty Shades Darker 2017 film now, Fifty Shades Darker movie, Watch Fifty Shades Darker 2017 Online 123movie, Watch Fifty Shades Darker 2017 Online Putlocker, Watch Fifty Shades Darker 2017 Online Megashare, streaming Fifty Shades Darker film, film Fifty Shades Darker 2017 download, Watch Fifty Shades Darker 2017 For Free online, Fifty Shades Darker film trailer, Watch Fifty Shades Darker 2017 Online Free, streaming film Fifty Shades Darker, Fifty Shades Darker movie trailer, Watch Fifty Shades Darker 2017 Online Free netflix, Streaming Fifty Shades Darker 2017 For Free Online, film Fifty Shades Darker 2017 online, Fifty Shades Darker 2017 live streaming film online, Fifty Shades Darker streaming, Streaming Fifty Shades Darker 2017 Online Free Megashare, movie Fifty Shades Darker 2017 trailer, Watch Fifty Shades Darker 2017 Online Viooz, Watch Fifty Shades Darker 2017 Online Free 123movie, watch full film Fifty Shades Darker 2017 online, Fifty Shades Darker live streaming movie, Watch Fifty Shades Darker 2017 Online Free megashare,