Angularjs app works on Chrome, but on IE it doesn’t work

Asked

Viewed 209 times

0

I have a web application C#, with a page with customer data. When changing the data using Chrome and then saving, the data saves to the database and, via screen, is updated correctly. When doing the same in IE, the page returns that saved, however, via screen, does not occur the update, but in the database the change was made.

View:

@{
    ViewBag.Title = "Cliente Sem Código no Itaú";
    Layout = "~/Views/Shared/_master.cshtml";
}

<div class="container" ng-controller="clienteSemCodigo">
    <ul class="nav nav-tabs" role="tablist">
        <li role="presentation" class="active">
            <a ng-show="cliente === null">
                Busca
            </a>
            <a ng-show="cliente !== null">
                <span class="glyphicon glyphicon-user"></span>
                {{cliente.Nome}}
            </a>
        </li>
    </ul>
    <br />
    <div class="tab-content">
        <div role="tabpanel" class="tab-panel active" id="divBusca">
            @* /////////////////////////////////////////////////////////////// *@
            @* Filtro *@
            <div class="panel panel-primary" ng-hide="cliente !== null">
                <div class="panel-heading" role="button" data-toggle="collapse" data-parent="#accordion" href="#collapseFiltro">
                    <strong>Filtros</strong> <small class="pull-right">Cliente sem código no Itaú</small>
                </div>
                <div id="collapseFiltro" class="panel-collapse collapse" role="tabpanel"
                     ng-class="{'in': cliente === null}">
                    <div class="panel-body">
                        <form id="frmBusca" novalidate>
                            <div class="row">
                                <div class="form-group col-md-4">
                                    <div class="input-group">
                                        <span class="input-group-addon">Código do cliente</span>
                                        <input type="number" id="txtCodigoCliente" placeholder="Código" ng-model="filtroCliente.CodigoBovespa" class="form-control" />
                                    </div>
                                </div>
                                <div class="form-group col-md-6">
                                    <div class="input-group">
                                        <span class="input-group-addon">Nome</span>
                                        <input type="text" id="txtNomeCliente" placeholder="Nome" ng-model="filtroCliente.Nome" class="form-control" />
                                    </div>
                                </div>
                                <div class="form-group col-md-2">
                                    <button type="submit" class="btn btn-primary btn-block" ng-click="ObterClientes(1)">
                                        <span class="glyphicon glyphicon-search"></span>
                                        Filtrar
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
            @* /////////////////////////////////////////////////////////////// *@
            @* Alerta: Cliente nao encontrados *@
            <div ng-show="clientes.length === 0 && cliente === null">
                <div class="alert alert-warning" role="alert">
                    <span class="glyphicon glyphicon-warning-sign"></span>
                    Nenhum cliente para exibição
                </div>
            </div>
            @* /////////////////////////////////////////////////////////////// *@
            @* Lista de Clientes Encontrados *@
            <div class="panel panel-default" ng-show="clientes !== null && clientes.length !== 0 && cliente === null">
                <div class="panel-body">
                    <table class="table table-striped align-all-center">
                        <thead>
                            <tr>
                                <th>Código</th>
                                <th style="text-align:left">Nome</th>
                                <th>Tipo Pessoa</th>
                                <th>CPF/CNPJ</th>
                                <th>Gestor</th>
                                <th>Agência</th>
                                <th style="width:10%">Conta</th>
                                <th>Código Assessor</th>
                                <th>Editar</th>
                                <th>Excluir</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ng-repeat="c in clientes">
                                <td>
                                    {{ c.CodigoBovespa }}
                                </td>
                                <td style="text-align:left">
                                    {{ c.Nome }}
                                </td>
                                <td>
                                    {{ c.TipoPessoa == 0 ? "PF" : "PJ" }}
                                </td>
                                <td>
                                    {{ c.CpfCnpj | cpfCnpj}}
                                </td>
                                <td>
                                    {{ c.CodigoGestor }}
                                </td>
                                <td>
                                    {{ c.CodigoAgencia }}
                                </td>
                                <td>
                                    {{ c.CodigoConta + "-" + c.DigitoConta  }}
                                </td>
                                <td>
                                    {{ c.CodigoAssessor }}
                                </td>
                                <td>
                                    <button type="button" ng-click="EditarClienteItau(c)" class="btn btn-primary" title="Clique aqui para editar todos os campos">
                                        <span class="glyphicon glyphicon-pencil"></span>
                                    </button>
                                </td>
                                <td>
                                    <button type="button" ng-click="ExcluirCliente(c)" class="btn btn-primary" title="Clique aqui para excluir o cliente" ng-click="ExcluirCliente(c)">
                                        <span class="glyphicon glyphicon-trash"></span>
                                    </button>
                                </td>
                            </tr>
                        </tbody>
                        <tfoot ng-show="gridPrincipal.totalDePaginas > 1">
                            <tr>
                                <td colspan="10">
                                    <div class="row">
                                        <div class="col-md-10">
                                            <div class="pull-left">
                                                <small>Página <kbd>{{ gridPrincipal.paginaAtual }}</kbd> de <kbd>{{ gridPrincipal.totalDePaginas }}</kbd></small>
                                            </div>
                                        </div>
                                        <div class="col-md-2">
                                            <div class="input-group">                                                
                                                <span class="input-group-btn">
                                                    <button class="btn btn-default btn-sm" type="button" ng-show="(gridPrincipal.paginaAtual > 1) && (gridPrincipal.totalDePaginas > 1)"
                                                            ng-click="ObterClientes(gridPrincipal.paginaAtual-1)">
                                                        <span class="glyphicon glyphicon-chevron-left"></span>
                                                    </button>
                                                </span>
                                                <select ng-model="gridPrincipal.paginaAtual" class="form-control input-sm" ng-change="ObterClientes()"
                                                        ng-options="page for page in range(gridPrincipal.totalDePaginas)"></select>

                                                <span class="input-group-btn">
                                                    <button class="btn btn-default btn-sm" type="button" ng-show="(gridPrincipal.paginaAtual !== gridPrincipal.totalDePaginas) && (gridPrincipal.totalDePaginas > 1)"
                                                            ng-click="ObterClientes(gridPrincipal.paginaAtual+1)">
                                                        <span class="glyphicon glyphicon-chevron-right"></span>
                                                    </button>
                                                </span>
                                            </div>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        </tfoot>
                    </table>
                </div>
            </div>
            @* /////////////////////////////////////////////////////////////// *@
            @* Cliente Detalhado *@
            <div class="panel panel-info" ng-show="cliente !== null">
                <div class="panel-heading clearfix">
                    <h4 class="pull-left">
                        <strong>Cliente Itaú</strong>
                    </h4>
                    <div class="pull-right">
                        <button type="button" class="btn btn-default" ng-click="Voltar()">
                            <span class="glyphicon glyphicon-arrow-left"></span>
                            Voltar
                        </button>
                    </div>
                </div>
                <div class="panel panel-body">
                    @* /////////////////////////////////////////////////////////////// *@
                    @* Dados do Cliente no Itáu *@
                    <form class="form-horizontal">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">Código Bovespa</label>
                            <div class="col-sm-2">
                                <input type="number" ng-model="cliente.CodigoBovespa" class="form-control" placeholder="Código">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">Nome</label>
                            <div class="col-sm-6">
                                <input type="text" ng-model="cliente.Nome" class="form-control" placeholder="Nome" maxlength="30">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">Tipo Pessoa</label>
                            <div class="col-sm-2">                                                                                                                            
                                <select class="form-control" ng-model="cliente.TipoPessoa"
                                        ng-options="t.Codigo as t.Descricao for t in tipoPessoa">                                    
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">CPF/CNPJ</label>
                            <div class="col-sm-4">
                                <input-cpf-cnpj id="txtCpfCnpj" cpf-cnpj-model="cliente.CpfCnpj"></input-cpf-cnpj>                                
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">Código do Gestor</label>
                            <div class="col-sm-2">
                                <input type="number" ng-model="cliente.CodigoGestor" class="form-control" placeholder="Código">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">Conta</label>
                            <div class="col-sm-10">

                                @* /////////////////////////////////////////// *@
                                @* Area: Conta *@
                                <div class="row">
                                    <div class="col-md-10">
                                        <div class="panel panel-default">
                                            <div class="panel-body">
                                                <div class="row">
                                                    <div class="col-md-4 col-sm-4">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">
                                                                Agência
                                                            </span>
                                                            <input type="number" ng-model="cliente.CodigoAgencia" class="form-control" placeholder="Código">
                                                        </div>
                                                    </div>
                                                    <div class="col-md-4 col-sm-4">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">
                                                                Código
                                                            </span>
                                                            <input type="number" ng-model="cliente.CodigoConta" class="form-control" placeholder="Código">
                                                        </div>
                                                    </div>
                                                    <div class="col-md-4 col-sm-4">
                                                        <div class="input-group">
                                                            <span class="input-group-addon">
                                                                Dígito
                                                            </span>
                                                            <input type="number" ng-model="cliente.DigitoConta" class="form-control" placeholder="Código">
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col-md-2">
                                    </div>
                                </div>

                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">Código do Assessor</label>
                            <div class="col-sm-2">
                                <input type="number" ng-model="cliente.CodigoAssessor" class="form-control" placeholder="Código">
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-offset-10 col-sm-2">
                                <button type="submit" class="btn btn-primary btn-block" ng-click="Salvar()">
                                    <span class="glyphicon glyphicon-floppy-disk"></span>
                                    Salvar
                                </button>
                            </div>
                        </div>                        
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

@section scripts{
    @Scripts.Render("~/Content/js/app/Itau/ClienteSemCodigo.js")
}
@section styles{
    <link href="@Url.Content("~/Content/css/Itau/ClienteSemCodigo.css")" rel="stylesheet" type="text/css" />
}
  • Shows the code you’ve already done, only frontend.

  • Wheel one jslint in your code, it should help identify some problem.

  • Have any messages in the browser console?

  • No message appears in the browser, I edited the question and put the front, I am using Angularjs also.

  • Now error appearing on console :SCRIPT5: Access denied.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.