app.controller("perfilController", function ($scope, $modal) {
    $scope.tipos = [];

    $scope.selectItem = function (row) {
        $scope.selectedRow = row;

    };

    $scope.inserirItem = function () {
        var n = $scope.tipos.length + 1;


        var it = {
            idperfil: n,
            descricao: 'Normal'
        }
        $scope.tipos.push(it);
    };

    $scope.perfilEditRow = function (row) {

        var modalInstance = $modal.open(
        {

            templateUrl: 'views/modalEditarPerfil.html',
            controller: 'modalController',
            resolve: {

                items: function () { return row; },

                //  isNew: false
            }
        });

        modalInstance.result.then(function (item) {
            $scope.selectedRow = item;

        }, function () {

        });

    };

   
});