Skip to content

Instantly share code, notes, and snippets.

@mranosa
mranosa / gist:4989561
Created February 19, 2013 20:23
promise
michaelw2: $http.get(url).then(function(response) { $scope.myObject = response.data; } )
[04:20am]
michaelw2: when the http request finishes the promise is resolved and the then fn is invoked. it's lexically scoped to the $scope and so it updates the $scope with the results
[04:21am] michaelw2: http transforms allow me to add methods, convert types, etc.
[04:21am] markenranosa: lol deep terms
[04:21am] conorm joined the chat room.
[04:21am] michaelw2: so here's your cheapo angular insight for the day
[04:21am] michaelw2: almost every single feature is there for a really really good reason and understanding that is key to effective use of angular
[04:21am] michaelw2: promises
[04:21am] dauterive left the chat room. (Read error: Connection reset by peer)
@mranosa
mranosa / mail.js
Last active December 13, 2015 17:49
send email
'use strict';
trippingIronmanApp.controller('ContactCtrl', ['$scope', '$http', function($scope, $http) {
$scope.email = {
name : '',
email : '',
message : ''
};
'use strict';
InspectormanApp.controller('MainCtrl', function($scope, $timeout, NotificationService,
StringValidator, ProgressBarService,
$location, NavService) {
$scope.username = '';
$scope.password = '';
$scope.isLoading = false;
use Rack::Static,
:urls => ["/images", "/scripts", "/views", "/css", "/font", "/styles"],
:root => "public"
run lambda { |env|
[
200,
{
'Content-Type' => 'text/html',
'Cache-Control' => 'public, max-age=86400'
<!DOCTYPE html>
<html>
<head>
<title>Our App</title>
<!-- Sencha Touch CSS -->
<link rel="stylesheet" href="resources/css/sencha-touch.css" type="text/css"></link>
<!-- Custom CSS -->
<link rel="stylesheet" href="resources/css/idm.css" type="text/css"></link>
inspectormanApp.controller('LoginCtrl', function($scope) {
$scope.user = {
username : "blah",
password : ""
}
});
<div class="login-box">
<form class="form-horizontal" ng-model="user">