Restangular, Firebase, ngRoute - rosalsm/TIY-GitHub GitHub Wiki

How do I configure a REST-ful API like Github?

In my repo, I will run npm install restangular or bower install restangular or in my index.thml adding to the scripts

<script type="text/javascript"src="http://cdnjs.cloudflare.com/ajax/libs/restangular/1.3.1/restangular.min.js"></script>     

How would I request a list of...

If they are like that class org/repos/issue

...Repos for the class Org?

Restangular.all("class Org")

...Issues for the class Repo?

Restangular.one("class Repo", issues)

...Issues for a specific Milestone?

Restangular.one("milestone", issues)

Firebase

What operations does the Firebase REST API support?

The basic operation through the REST API is PUT(writing data with a PUT request) We can issue an HTTP GET request to the same endpoint to read the data we saved. POST request. Pushing data. Equivalent of the JS push() method. Adding data. PATCH request. Updating data. Equivalent of JS update() function. Overwriting info to update info, just the children they have to be updated. DELETE request. Removing data

Do I need to authenticate with Firebase to read or create data?

You need to use authentication (the process of proving user's identity) using your Firebase app's secret or an authentication token (secure JSON web tokens(JWTs)).

What format does Firebase expect data to be in?

All Firebase database data is stored as JSON objects.

ngRoute

The ngRoute module provides routing and deeplinking services and directives for angular apps.

How do I define...

...a route for my application with ngRouter?

$route is used for deep-liking URLs to controllers and views(HTML partials). It watches `$location.url() and tries to map the path to an existing route definition

...dynamic pieces (params) to routes?

$routeParams service allows you to retrieve the current set of route parameters. The route parameters are a combination of $location'ssearch() and path() parameters are extracted when the $route path is matched.

...the template to load for a route?

...the controller to trigger for a route?

How do I retrieve...

...the params from a route in a controller?

...the controller for a route in the view?

⚠️ **GitHub.com Fallback** ⚠️