Skip to content

Instantly share code, notes, and snippets.

@flipjs-sublime
flipjs-sublime / ng-promise.js
Last active August 29, 2015 14:06
Angular: Promise
angular.module('app', [])
.service('UserService', function($http, $q) {
this.users = []
this.user = {}
function getData(obj, prop, id) {
var q = $q.defer()
var url = '/users/'
$http.get(url + id).success(function(response) {
obj[prop] = response
@flipjs-sublime
flipjs-sublime / gist-html-angular-bootstrap.html
Last active August 29, 2015 14:05
HTML: Angular Bootstrap
<!-- index.html -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Angular App</title>
<!-- SCROLLS -->
<!-- load bootstrap and fontawesome via CDN -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link href="css/bootstrap.min.css" rel="stylesheet">