var app = angular.module('materializeApp', ['ui.materialize']) .controller('BodyController', ["$scope", function ($scope) { $scope.select = { value1: "Option1", value2: "I'm an option", value3: ["Option1", "I'm an option"], choices: ["Option1", "I'm an option", "This is materialize", "No, this is Patrick."] }; $scope.dummyInputs = {}; $scope.toast = function (message, duration) { Materialize.toast(message, duration); } }]) .controller('CollapsibleController', ["$scope", function ($scope) { $scope.collapsibleElements = [{ icon: 'mdi-image-filter-drama', title: 'First', content: 'Lorem ipsum dolor sit amet.' },{ icon: 'mdi-maps-place', title: 'Second', content: 'Lorem ipsum dolor sit amet.' },{ icon: 'mdi-social-whatshot', title: 'Third', content: 'Lorem ipsum dolor sit amet.' }]; }]) .controller('ChipsController', ["$scope", function ($scope) { $scope.chips = [{ tag: 'Apple', }, { tag: 'Microsoft', },{ tag: 'Google', }]; }]) .controller('ToastController', ["$scope", function ($scope) { $scope.callback = function(message) { alert(message); }; }]).controller('PaginationController', ["$scope", function ($scope) { $scope.changePage = function (page) { Materialize.toast("Changed to page " + page, 1000); } }]) .controller('DateController', ["$scope", function ($scope) { var currentTime = new Date(); $scope.currentTime = currentTime; $scope.month = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; $scope.monthShort = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; $scope.weekdaysFull = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; $scope.weekdaysLetter = ['S', 'M', 'T', 'W', 'T', 'F', 'S']; $scope.disable = [false, 1, 7]; $scope.today = 'Today'; $scope.clear = 'Clear'; $scope.close = 'Close'; var days = 15; $scope.minDate = (new Date($scope.currentTime.getTime() - ( 1000 * 60 * 60 *24 * days ))).toISOString(); $scope.maxDate = (new Date($scope.currentTime.getTime() + ( 1000 * 60 * 60 *24 * days ))).toISOString(); $scope.onStart = function () { console.log('onStart'); }; $scope.onRender = function () { console.log('onRender'); }; $scope.onOpen = function () { console.log('onOpen'); }; $scope.onClose = function () { console.log('onClose'); }; $scope.onSet = function () { console.log('onSet'); }; $scope.onStop = function () { console.log('onStop'); }; }]).controller("ModalController", ["$scope", function (scope) { scope.readyCallback = function () { Materialize.toast("Modal ready", 1000); } scope.completeCallback = function () { Materialize.toast("Modal complete", 1000); } scope.openModal = false; }]);