pip-webui
Version:
HTML5 UI for LOB applications
118 lines (112 loc) • 4.78 kB
JavaScript
/* global angular */
(function () {
'use strict';
var thisModule = angular.module('appMaterial.List', []);
thisModule.controller('ListController',
function($scope, $mdDialog) {
$scope.toppings = [
{ name: 'Pepperoni', wanted: true },
{ name: 'Sausage', wanted: false },
{ name: 'Black Olives', wanted: true },
{ name: 'Green Peppers', wanted: false }
];
$scope.settings = [
{ name: 'Wi-Fi', extraScreen: 'Wi-fi menu', icon: 'device:network-wifi', enabled: true },
{ name: 'Bluetooth', extraScreen: 'Bluetooth menu', icon: 'device:bluetooth', enabled: false },
];
$scope.messages = [
{id: 1, title: "Message A", selected: false},
{id: 2, title: "Message B", selected: true},
{id: 3, title: "Message C", selected: true},
];
$scope.people = [
{ name: 'Janet Perkins', img: 'img/100-0.jpeg', newMessage: true },
{ name: 'Mary Johnson', img: 'img/100-1.jpeg', newMessage: false },
{ name: 'Peter Carlsson', img: 'img/100-2.jpeg', newMessage: false }
];
$scope.goToPerson = function(person, event) {
$mdDialog.show(
$mdDialog.alert()
.title('Navigating')
.textContent('Inspect ' + person)
.ariaLabel('Person inspect demo')
.ok('Neat!')
.targetEvent(event)
);
};
$scope.navigateTo = function(to, event) {
$mdDialog.show(
$mdDialog.alert()
.title('Navigating')
.textContent('Imagine being taken to ' + to)
.ariaLabel('Navigation demo')
.ok('Neat!')
.targetEvent(event)
);
};
$scope.doPrimaryAction = function(event) {
$mdDialog.show(
$mdDialog.alert()
.title('Primary Action')
.textContent('Primary actions can be used for one click actions')
.ariaLabel('Primary click demo')
.ok('Awesome!')
.targetEvent(event)
);
};
$scope.doSecondaryAction = function(event) {
$mdDialog.show(
$mdDialog.alert()
.title('Secondary Action')
.textContent('Secondary actions can be used for one click actions')
.ariaLabel('Secondary click demo')
.ok('Neat!')
.targetEvent(event)
);
};
var imagePath = 'img/list/60.jpeg';
$scope.phones = [
{ type: 'Home', number: '(555) 251-1234' },
{ type: 'Cell', number: '(555) 786-9841' },
{ type: 'Office', number: '(555) 314-1592' }
];
$scope.todos = [
{
face : imagePath,
what: 'Brunch this weekend?',
who: 'Min Li Chan',
when: '3:08PM',
notes: " I'll be in your neighborhood doing errands"
},
{
face : imagePath,
what: 'Brunch this weekend?',
who: 'Min Li Chan',
when: '3:08PM',
notes: " I'll be in your neighborhood doing errands"
},
{
face : imagePath,
what: 'Brunch this weekend?',
who: 'Min Li Chan',
when: '3:08PM',
notes: " I'll be in your neighborhood doing errands"
},
{
face : imagePath,
what: 'Brunch this weekend?',
who: 'Min Li Chan',
when: '3:08PM',
notes: " I'll be in your neighborhood doing errands"
},
{
face : imagePath,
what: 'Brunch this weekend?',
who: 'Min Li Chan',
when: '3:08PM',
notes: " I'll be in your neighborhood doing errands"
},
];
}
);
})();