generator-angular-material-fullstack
Version:
Yeoman generator for creating MEAN stack applications, using MongoDB, Express, AngularJS, and Node
19 lines (16 loc) • 482 B
JavaScript
;
angular.module('<%= scriptAppName %>')
.controller('DialogController', function ($scope, $mdDialog<% if(filters.mongoose) { %>, $http<% } %>) {
$scope.closeDialog = function() {
$mdDialog.hide();
};
<% if(filters.mongoose) { %>
$scope.addThing = function() {
if($scope.newThing === '') {
return;
}
$http.post('/api/things', { name: $scope.newThing });
$scope.newThing = '';
$mdDialog.hide();
};<% } %>
});