Why can not I get the form data?

0

Something very strange is happening, the first time this happens. I have a registration form. When I click save, the console appears 'undefined' and it aligns ... Impossible to be 'undefined' because there are data filled !!! See below:

HTML

<form name="formAddress" ng-controller="InicialCtrl">
    <label>Nome do estabelecimento</label>
    <input class="form-control" type="text" name="name" mg-model="estabele.nome">

    <label>CEP</label>
    <input class="form-control" type="text" name="cep" mg-model="estabele.cep">

    <label>Endereço</label>
    <input class="form-control" type="text" name="address" mg-model="estabele.and" >

    <label>Cidade</label>
    <input class="form-control" type="text" name="city" mg-model="estabele.cidade" >

    <label>UF</label>
    <input class="form-control" type="text" name="uf" mg-model="estabele.uf" >

    <label>Contato</label>
    <input class="form-control" type="text" name="phone" mg-model="estabele.telefone">

    <button class="btn btn-block btn-primary btnRegister" ng-click="cadastro(estabele)">Cadastrar</button>
</form>

controller:

app.controller("InicialCtrl", ['$scope', '$http', '$window', '$location', '$rootScope', function ($scope, $http, $window, $location, $rootScope) {

$scope.cadastro = function(estabele){
    console.log(estabele);
}

}]);
    
asked by anonymous 20.07.2017 / 20:31

1 answer

3

Because you are using mg-model instead of ng-model .

    
20.07.2017 / 20:35