when I click on the submit button ng-if condition should be enabled in DOM and I should able to access the Input element properties or I can apply some class to it
<div ng-app="myModule">
<div ng-controller="myController">
<div ng-if="addInput">
<input value="123456" id="addInput">
</div>
<input type="submit" ng-click="login()" value="Login">
</div>
</div>
Controller code was
var module = angular.module("myModule", []);
module.controller("myController", function($scope) {
$scope.addInput=false;
$scope.login = function () {
$scope.addInput = true;
var invar= document.getElementById('addInput');
var invalue = invar.value();
console.log("value was " + invalue);
};
});
jsfiddle Example: https://jsfiddle.net/f0aewhuy/ , In dev console I'm able to see error.
How can I acheive it?
Thank you