Syncing Data With Firebase Using Ionic Framework

$scope.list = function() { fbAuth = fb.getAuth(); if(fbAuth) { var sync = $firebase(fb.child(“users/” + fbAuth.uid)); var syncObject = sync.$asObject(); syncObject.$bindTo($scope, “data”); } } Once syncObject is bound to $scope.data, which is provided by AngularFire, data will be synchronized consistently in three ways (UI, $scope.data, and Firebase): Calling $scope.data.todos.push({title: result}); will update the UI and also […]

SWAPI — The Star Wars API

$ curl -X GET http://swapi.co/api/people/1/ { "name": "Luke Skywalker", "height": "1.72 m", "mass": "77 Kg", "hair_color": "Blond", "skin_color": "Caucasian", "eye_color": "Blue", "birth_year": "19 BBY", "gender": "Male", "homeworld": "http://swapi.co/api/planets/1/", "films": [ "http://swapi.co/api/films/1/", "http://swapi.co/api/films/2/", "http://swapi.co/api/films/3/" ], "species": [ "http://swapi.co/api/species/1/" ], "vehicles": [ "http://swapi.co/api/vehicles/14/", "http://swapi.co/api/vehicles/30/" ], "starships": [ "http://swapi.co/api/starships/12/", "http://swapi.co/api/starships/22/" ], "created": "2014-12-09T13:50:51.644000Z", "edited": "2014-12-10T13:52:43.172000Z", "url": "http://swapi.co/api/people/1/" } […]

Reqres – Test your front-end against a real API

Reqres simulates real application scenarios. If you want to test a user authentication system, Reqres will respond to a successful login/register request with a token for you to identify a sample user, or with a 403 forbidden response to an unsuccessful login/registration attempt. Great to see an initiative like this. Nearly three years ago I […]

Slate – Beautiful static documentation for your API

Slate helps you create beautiful API documentation. Think of it as an intelligent, responsive documentation template for your API. Slate – Beautiful static documentation for your API → Tutorial: Writing API Documentation with Slate → Related: Swagger, a dynamic documentation generator

Building an HTML5 Text Editor with the FileSystem APIs

// Save a file in the FileSystem. function saveFile(filename, content) { filesystem.root.getFile(filename, {create: true}, function(fileEntry) { fileEntry.createWriter(function(fileWriter) { fileWriter.onwriteend = function(e) { // Update the file browser. listFiles(); // Clean out the form field. filenameInput.value = ”; contentTextArea.value = ”; // Show a saved message. messageBox.innerHTML = ‘File saved!’; }; fileWriter.onerror = function(e) { console.log(‘Write […]

Swagger

Speaking of APIs and documentation in the previous post: Swagger is a specification and complete framework implementation for describing, producing, consuming, and visualizing RESTful web services. Describe your API in a JSON file like this, and Swagger will turn it into that. Alternatively you can provide your project with Swagger Annotations and then run it […]

Your API Consumers Aren’t Who You Think They Are

Traditionally, you’d expect most inquiries about APIs to be very technical: How can I upload bulk attachments with multipart POST bodies? Increasingly, questions are becoming more like amateur Stack Overflow questions: How do I hook the Microsoft Access into the REST? The users behind such questions aren’t tech-illiterate, they simply have no idea how to […]