Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
import React from 'react'; | |
import expect from 'expect'; | |
import {createRenderer} from 'react-addons-test-utils'; | |
import expectJSX from 'expect-jsx'; | |
expect.extend(expectJSX); | |
import Hello from './Hello.js'; | |
describe('Hello World', () => { | |
it('works', () => { |
This file contains 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
import React from 'react'; | |
class Hello extends React.Component { | |
render() { | |
return <span>Hello {this.props.name}</span>; | |
} | |
} | |
export default Hello; |
This file contains 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
<template name="menuItems"> | |
<div class="slideout-menu"> | |
<h3>Menu <a href="#" class="slideout-menu-toggle">×</a></h3> | |
<ul> | |
{{#if currentUser}} | |
<li> | |
<a href="{{pathFor 'deviceNew'}}">Add a Device</a> | |
</li> | |
{{/if}} | |
<li><a href="#">Home <i class="fa fa-angle-right"></i></a></li> |
This file contains 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
//route | |
$routeProvider.when('/add', {templateUrl: 'partials/addDevice.html', controller: 'addDeviceController'}); | |
//controller | |
.controller('addDeviceController', ['$scope', '$location', 'Devices', | |
function($scope, $location, Devices) { | |
$scope.add=true; | |
$scope.add = function(device){ | |
if(!device) return; |
This file contains 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
'use strict'; | |
/* jasmine specs for services go here */ | |
describe('service', function() { | |
beforeEach(function(){ | |
module('cotd.services'); | |
module('ngResource'); | |
}); |
This file contains 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
'use strict'; | |
/* jasmine specs for controllers go here */ | |
/* Define all the services and controllers module, so they are accessable in your it's | |
*/ | |
describe('controllers', function(){ | |
beforeEach(function(){ | |
module('cotd.controllers'); | |
module('cotd.services'); |
This file contains 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
var devices = [ | |
{id:0, name: "iphone", assetTag:"a23456", owner:"dev", desc:"iOS4.2"}, | |
{id:1, name: "loaner-laptop-1", assetTag:"a13936", owner:"dev", desc:""}, | |
{id:2, name: "loaner-laptop-3", assetTag:"a43056", owner:"qa", desc:""}, | |
{id:3, name: "android", assetTag:"a33756", owner:"dev", desc:"android2.4"}, | |
{id:4, name: "galaxy tab", assetTag:"a53356", owner:"dev", desc:"android"}, | |
{id:5, name: "loaner-laptop-2", assetTag:"a63556", owner:"qa", desc:""}, | |
{id:6, name: "iphone", assetTag:"a73856", owner:"dev", desc:"iOS5"} | |
]; |
This file contains 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
var express = require('express'), | |
items = require('./routes/devices.js'); | |
var app = express(); | |
// Read | |
app.get('/devices', items.findAll); | |
// View one device | |
app.get('/device/:id', items.findById); |
NewerOlder