Created
September 18, 2013 15:31
-
-
Save st23am/6610948 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
p { | |
padding-bottom: 5px; | |
border-bottom: 1px solid #000; | |
} |
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> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body ng-app="propUp"> | |
<div class="hero-unit" ng-controller="MainCtrl"> | |
<div class="props" ng-repeat="prop in props"> | |
<p>{{prop.person}} was given props by {{prop.submitter}} for: | |
{{prop.reason}} | |
</p> | |
</div> | |
<fieldset> | |
<ul> | |
<li> | |
<label> Submitter </label> | |
<input type="text" ng-model="newProp.submitter"/> | |
</li> | |
<li> | |
<label> Person </label> | |
<input type="text" ng-model="newProp.person"/> | |
</li> | |
<li> | |
<label> Reason </label> | |
<textarea ng-model="newProp.reason"></textarea> | |
<button type="submit" ng-click="addProp()">Give Props</button> | |
</li> | |
</ul> | |
</fieldset> | |
</div> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script> | |
<script src="https://cdn.firebase.com/v0/firebase.js"></script> | |
<script src="https://cdn.firebase.com/libs/angularfire/0.3.0/angularfire.min.js"></script> | |
</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
app = angular.module("propUp", ["firebase"]); | |
app.controller('MainCtrl', function($scope, angularFire) { | |
var ref; | |
ref = new Firebase("https://angularfireblogpost1.firebaseio.com/props"); | |
$scope.props = []; | |
$scope.addProp = function() { | |
$scope.props.push($scope.newProp); | |
return $scope.newProp = ""; | |
}; | |
return angularFire(ref, $scope, "props"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment