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
// controllers | |
function deviceListController($scope) | |
{ | |
$scope.devices = [ | |
{name: "iphone", assetTag:"a23456", owner:"dev", desc:"iOS4.2"}, | |
{name: "loaner-laptop-1", assetTag:"a13936", owner:"dev", desc:""}, | |
{name: "loaner-laptop-3", assetTag:"a43056", owner:"qa", desc:""}, | |
{name: "android", assetTag:"a33756", owner:"dev", desc:"android2.4"}, | |
{name: "galaxy tab", assetTag:"a53356", owner:"dev", desc:"android"}, |
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
// create a module to support getting and managing the device list | |
var deviceModule = angular.module('DeviceModule', []); | |
// setup the service factory to create our items. Should retrieve from the server side db | |
deviceModule.factory('Devices', function(){ | |
var items = {}; | |
items.query = function(){ | |
return [ | |
{id:0, name: "iphone", assetTag:"a23456", owner:"dev", desc:"iOS4.2"}, |
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
<html ng-app="cotd"> | |
<head> | |
<title>Check out your device</title> | |
<link rel="stylesheet" href="../bootstrap/css/bootstrap.css"> | |
</head> | |
<body> | |
<h2>List of Devices</h2> | |
<div ng-view></div> | |
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
<div ng-controller="deviceListController"> | |
<table class="table"> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Asset Tag</th> | |
<th>Owner</th> | |
<th>Description</th> | |
</tr> | |
</thead> |
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
// Global app module listing all its dependencies | |
var cotdServices = angular.module('cotd', ['DeviceModule']); | |
// setup mappings routes and templates | |
function cotdRouteConfig($routeProvider){ | |
$routeProvider. | |
when('/', { | |
controller: deviceListController, | |
templateUrl: 'listDevices.html' | |
}). |
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
Mac:cotd$ sudo nginx | |
Mac:cotd$ ps -ef|grep nginx | |
0 22354 1 0 5:10PM ?? 0:00.00 nginx: master process nginx | |
-2 22355 22354 0 5:10PM ?? 0:00.00 nginx: worker process | |
502 22357 19529 0 5:10PM ttys000 0:00.00 grep nginx | |
STOPPING NGINX | |
Mac:cotd$ sudo nginx -s stop | |
Mac:cotd$ ps -ef|grep nginx |
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
<div ng-controller="deviceListController"> | |
<div ng-hide="devices.length"> | |
You have no devices setup. | |
<a href="#/admin/add-new">Would you like to add?</a> | |
</div> |
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
<div ng-controller="addDeviceController"> | |
<form novalidate name="addDevice" class="form-horizontal"> | |
<div class="control-group"> | |
<label class="control-label">Name</label> | |
<div class="controls"> | |
<input type="text" id="name" placeholder="Enter Name"> | |
</div> | |
</div> | |
<div class="control-group"> | |
<label class="control-label">Asset Tag</label> |
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
<div ng-controller="addDeviceController"> | |
<form novalidate name="addDevice" class="form-horizontal"> | |
<div class="control-group"> | |
<label class="control-label">Name</label> | |
<div class="controls"> | |
<input type="text" id="name" ng-model="device.name" required placeholder="Enter Name"> | |
</div> | |
</div> | |
<div class="control-group"> | |
<label class="control-label">Asset Tag</label> |
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
// create a module to support getting and managing the device list | |
var deviceModule = angular.module('DeviceModule', []); | |
// setup the service factory to create our items. Should retrieve from the server side db | |
deviceModule.factory('Devices', function(){ | |
var items = {}; | |
items.data = [ | |
{id:0, name: "iphone", assetTag:"a23456", owner:"dev", desc:"iOS4.2"}, | |
{id:1, name: "loaner-laptop-1", assetTag:"a13936", owner:"dev", desc:""}, |
OlderNewer