Whenver I have an Angular expression as a value to input
\'s type
, it won\'t work:
yes you can ... at least now :)
HTML:
JS:
var myApp = angular.module('myApp', []);
myApp.controller('mainCtrl', ['$scope', function( $scope ){
// Set the default value of inputType
$scope.inputType = 'password';
// Hide & show password function
$scope.hideShowPassword = function(){
if ($scope.inputType == 'password')
$scope.inputType = 'text';
else
$scope.inputType = 'password';
};
}]);
source: http://codepen.io/gymbry/pen/fJchw/
UPDATE 17/04/2015:
I have randomly changed Angular version in above Codepen and this seems to work from version 1.0.2 ... Hope this help ...