This is the Ractive.js clock example implemented in AngularJS. A working Plunkr is also available.
Much of the JavaScript, most of the HTML, and all of the CSS was taken directly from the Ractive.js example for minimal differences in the samples.
User.methods.setPassword = function(password, callback) { | |
bcrypt.hash(password, 10, function(err, hash) { | |
if (err) return callback(err); | |
this.passwordHash = hash; | |
callback(); | |
}.bind(this)); | |
}; | |
// To use in, e.g., a controller | |
user.setPassword(req.body.password, function(err) { |
# RealmsController is the only controller in the application, which fetches | |
# the realm list from the Realms service and displays them in a list. | |
app.controller 'RealmsController', ($scope, $timeout, $window, Realms, hashChange) -> | |
$scope.realms = [] | |
$scope.search = '' | |
$scope.lastUpdate = null | |
# Any time the URL hash changes, update the `search` variable. | |
hashChange (value) -> | |
$scope.search = value |
This is the Ractive.js clock example implemented in AngularJS. A working Plunkr is also available.
Much of the JavaScript, most of the HTML, and all of the CSS was taken directly from the Ractive.js example for minimal differences in the samples.
event = require('pilot/event') | |
Anchor = require('ace/anchor').Anchor | |
doc = ace_editor.session.getDocument() | |
editablePositions = [[1, 0, 2, 0]] # allow editong only the second row | |
jQuery.each editable, (index, row) -> | |
editablePositions.push [new Anchor(doc, row[0], row[1]), new Anchor(doc, row[2], row[3])] | |
Range = require('ace/range').Range |
var Parent = require('./parent'), | |
util = require('util'); | |
var Child = function() { | |
this.child = 'child'; | |
}; | |
util.inherits(Child, Parent); | |
Child.prototype.A = function() { |
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(100); |
module Homepage | |
module V2 | |
class Board | |
include Redis::Objects | |
value :name | |
value :exists | |
counter :views | |
HTML5 Dev Conf: AngularJS, a Framework for Web Applications (slides)
angular.module('angular-fb.controllers', []) | |
.controller('MainController', ['$scope', '$http', function($scope, $http) { | |
$scope.usernames = []; | |
$scope.demoUsers = [ | |
"tilley.brandon", | |
"grockit", | |
"nodecasts", | |
"adobe", | |
"cocacola", | |
"pepsi" |
var connect = require('connect'); | |
var fs = require('fs'); | |
var querystring = require('querystring'); | |
var util = require('util'); | |
var pageMarkup = 'Error'; | |
var staticFiles = new Array(); | |
try { | |
staticFiles['/'] = fs.readFileSync('page.html', 'ascii'); | |
staticFiles['/jquery-1.7.1.min.js'] = fs.readFileSync('jquery-1.7.1.min.js', 'ascii'); |