Sum of 2 values with button in AngularJS

0

I would like to know what is going wrong because when I do the ng-click function in HTML the {{resultado}} appears as NaN .

HTML

 

        <button class="button button-full button-positive" ngclick="juntarTotal()">
          Juntar os dois campos
        </button>

        <h3>{{resultado}}</h3>

controller.js

angular.module('app.controllers', [])

.controller('doisnumerosController', function($scope){
    $scope.juntarTotal = () => {
      $scope.resultado = $scope.valor1 + $scope.valor2;
    }
});
    
asked by anonymous 07.03.2018 / 07:25

0 answers