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
function BankAccount(ownerName, begBalance) { | |
var accountNumber = new Date().getTime() + ''; | |
this.ownerName = ownerName; | |
this.balance = begBalance; | |
this.getAccountNumber = function() { return accountNumber; }; | |
} | |
BankAccount.prototype.deposit = function(amount) { |
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
# This file should contain all the record creation needed to seed the database with its default values. | |
# The data can then be loaded with the rake db:seed (or created alongside the db with db:setup). | |
# | |
# Examples: | |
# | |
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) | |
# Mayor.create(name: 'Emanuel', city: cities.first) | |
hippos = Hippo.create( | |
[{name:"Peter the Hippo",age:29,weight:2334,price:947.59}, |
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
angular.module('hipposApp', []) | |
.controller('HomeController', HomeController); | |
function HomeController($scope, $http) { | |
$http.get('/api/hippos') | |
.success(function(data) { | |
$scope.hippos = data; |
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
<!-- Add this HTML to the end of the existing HTML, just above the Socket.IO script. --> | |
<hr> | |
<div class="row"> | |
<div class="col-xs-4"> | |
<h4>Hippo Live Chat</h4> | |
</div> | |
<div class="col-xs-8 text-right"> | |
<label>Your Name:</label> <input type="text" ng-model="username"> | |
<button ng-click="sendMsg()" class="btn btn-success">Send Message</button> |
This presentation is available at: https://presentations.generalassemb.ly/2e967bd4959638cac82f
OlderNewer