angular-material-npfixed
Version:
The Angular Material project is an implementation of Material Design in Angular.js. This project provides a set of reusable, well-tested, and accessible Material Design UI components. Angular Material is supported internally at Google by the Angular.js, M
79 lines (70 loc) • 2.4 kB
JavaScript
angular.module('listDemo2', ['ngMaterial'])
.config(function($mdIconProvider) {
$mdIconProvider
.iconSet('social', 'img/icons/sets/social-icons.svg', 24)
.iconSet('device', 'img/icons/sets/device-icons.svg', 24)
.iconSet('communication', 'img/icons/sets/communication-icons.svg', 24)
.defaultIconSet('img/icons/sets/core-icons.svg', 24);
})
.controller('ListCtrl', 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)
);
};
});