Skip to content

Commit

Permalink
#4 Refactoring angular object name and some html
Browse files Browse the repository at this point in the history
  • Loading branch information
eysteinbye committed Mar 12, 2014
1 parent a2e461a commit 1231752
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions index.htm
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,33 @@ <h1>ShowMe.</h1>
</span>

<div data-ng-show="user" id="messagesDiv">
<div data-ng-repeat="msg in messages"><em>{{msg.name}}</em>: {{msg.desc}}-{{msg.product}}</div>
<div data-ng-repeat="msg in products"><em>{{msg.name}}</em>: {{msg.desc}}-{{msg.product}}</div>
</div>

<label>
Description
<input data-ng-show="user" type="text" data-ng-model="desc" data-ng-keydown="addMessage($event)" placeholder="Description...">
</label>
</label><br />
<label>
Product name
<input data-ng-show="user" type="text" data-ng-model="product" data-ng-keydown="addMessage($event)" placeholder="Product name...">
</label>
</label><br />
<label>
Time
<input data-ng-show="user" type="text" data-ng-model="startTime" data-ng-keydown="addMessage($event)" placeholder="Time...">
</label>
</label><br />
<label>
ShowID
<input data-ng-show="user" type="text" data-ng-model="showId" data-ng-keydown="addMessage($event)" placeholder="ShowID...">
</label>
</label><br />
<label>
Code
<input data-ng-show="user" type="text" data-ng-model="code" data-ng-keydown="addMessage($event)" placeholder="Code...">
</label>
</label><br />
<label>
CodeType
<input data-ng-show="user" type="text" data-ng-model="codeType" data-ng-keydown="addMessage($event)" placeholder="CodeType...">
</label>
</label><br />
<label>
Image
<input data-ng-show="user" type="text" data-ng-model="imageUrl" data-ng-keydown="addMessage($event)" placeholder="Image">
Expand Down
6 changes: 3 additions & 3 deletions js/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ function SaveController($scope, angularFire, angularFireAuth) {
var ref = new Firebase("https://eysteinbye.firebaseio.com/showme");
angularFireAuth.initialize(ref, { scope: $scope, name: "user" });

angularFire(ref, $scope, "messages");
angularFire(ref, $scope, "products");

$scope.messages = [];
$scope.products = [];

$scope.addMessage = function(e) {
if (e.keyCode != 13) return;

$scope.messages.push({
$scope.products.push({
name: $scope.user.name,
product: $scope.product,
startTime: $scope.startTime,
Expand Down

0 comments on commit 1231752

Please sign in to comment.