%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /var/www/html/news/public/scripts/controllers/inappropriateWords/
Upload File :
Create Path :
Current File : /var/www/html/news/public/scripts/controllers/inappropriateWords/inappropriateWords.controller.js

'use strict';

angular.module('controllers').controller('inappropriateWordsController', function ($scope, resource, queryBuilder, notification) {

    function internalSearch() {
        resource.forResource('inappropriateWords').get().then(function (res) {
            $scope.words = res.data;
        }, function (err) {
            notification.error(err);
        });
    }

    $scope.save = function (item) {
        resource.forResource('inappropriateWords').save(item).then(function (res) {
            notification.success('Inappropriate word created successfully');
            internalSearch();
        }, function (error) {
            notification.error(error);
        });
    };

    $scope.delete = function (item) {
        resource.forResource('inappropriateWords').delete(item.id).then(function (res) {
            notification.success('Inappropriate word deleted successfully');
            internalSearch();
        }, function (error) {
            notification.error(error);
        });
    };

    internalSearch();

});

Zerion Mini Shell 1.0