Created
June 30, 2014 03:58
-
-
Save JayMc/d293ac97aef75a1e2375 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html ng-app="plunker"> | |
| <head> | |
| <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script> | |
| <script src="http://cdnjs.cloudflare.com/ajax/libs/restangular/1.3.1/restangular.min.js" type="text/javascript"></script> | |
| <script data-require="lodash.js@*" data-semver="2.4.1" src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/2.4.1/lodash.js"></script> | |
| <meta charset="utf-8" /> | |
| <title>AngularJS Plunker</title> | |
| <script>document.write('<base href="' + document.location + '" />');</script> | |
| <link rel="stylesheet" href="style.css" /> | |
| </head> | |
| <body ng-controller="MainCtrl"> | |
| <p>Hello {{name}}!</p> | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var app = angular.module('plunker', ['restangular']); | |
| app.config(function(RestangularProvider) { | |
| RestangularProvider.setBaseUrl('https://1389350211841.firebaseio.com/restangularTest'); | |
| RestangularProvider.setRequestSuffix('.json'); | |
| }); | |
| app.controller('MainCtrl', function($scope,Restangular) { | |
| $scope.name = 'World'; | |
| // First way of creating a Restangular object. Just saying the base URL | |
| var baseAccounts = Restangular.all('accounts'); | |
| // This will query /accounts and return a promise. | |
| baseAccounts.getList().then(function(accounts) { | |
| $scope.allAccounts = accounts; | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment