Skip to content

Instantly share code, notes, and snippets.

{
init: function(elevators, floors) {
elevators.forEach(function(e) {
e.on("floor_button_pressed", function(fn) {
e.goToFloor(fn);
});
});
floors.forEach(function(f) {
f.on("up_button_pressed down_button_pressed", function() {
{
init: function(elevators, floors) {
e = elevators[0];
e.on("floor_button_pressed", function(fn) {
e.goToFloor(fn);
});
floors.forEach(function(f) {
f.on("up_button_pressed down_button_pressed", function() {
e.goToFloor(f.floorNum());
});
@Sin330
Sin330 / sample03.coffee
Last active October 4, 2016 11:00
ng_sample for KEIS blog
(->
class Sample03Controller
constructor: () ->
@title = 'Sample03'
@model =
list: [
{code: 100, name: 'おにぎり(梅)', price: 120}
{code: 101, name: 'おにぎり(鮭)', price: 150}
{code: 200, name: '味噌汁', price: 100}
{code: 300, name: 'のり弁', price: 380}
@Sin330
Sin330 / sample02.coffee
Last active September 8, 2016 15:40
ng_sample for KEIS blog
(->
class Sample02Controller
constructor: () ->
@title = 'Sample02'
@model =
checkbox: true
angular
.module 'mainApp'
.controller 'Sample02Controller', Sample02Controller
@Sin330
Sin330 / sample01.coffee
Created July 24, 2016 03:39
ng_sample for KEIS Blog
(->
class Sample01Controller
constructor: () ->
@title = 'Sample01'
@model =
name: 'AngularJS'
angular
.module 'mainApp'
.controller 'Sample01Controller', Sample01Controller
(->
class MainController
constructor: () ->
@model =
title: 'AngularJS入門'
angular
.module 'mainApp', ['ngRoute']
.config [
'$routeProvider'
@Sin330
Sin330 / index.html
Last active July 12, 2016 15:31
ng_sample for KEIS Blog
<!DOCTYPE HTML>
<html lang="ja" ng-app="mainApp">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>AngularJS入門</title>
<script src="/bower_components/material-design-lite/material.min.js"></script>
<script src="/bower_components/angular/angular.min.js"></script>
<script src="/bower_components/angular-route/angular-route.min.js"></script>
<script src="assets/js/main.js"></script>
<script src="assets/js/sample01.js"></script>