Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

angular readonly/Disabled if value is not null

(a) add property at component.ts 

export class UserAddUpdateComponent implements OnInit {
    readOnly :boolean = this.data != null ? true:false;
(b) in component.html
   <input
    [disabled]="this.readOnly"
   />
Comment

PREVIOUS NEXT
Code Example
Javascript :: get all iinputs of type button 
Javascript :: Fancybox 2 show error image when not having any image 
Javascript :: how to rotate camera around three JS object 
Javascript :: remove attribute disabled javascript 
Javascript :: jquery select radio 
Javascript :: javascript howto get xhr 
Javascript :: js get string byte size 
Javascript :: daterangepicker change 
Javascript :: url regex 
Javascript :: jquery to set value in select2 dropdown button 
Javascript :: javascript has string 
Javascript :: larger text console javascript 
Javascript :: convert string array to objectid mongoose 
Javascript :: Sort an array using setTimeout function 
Javascript :: when i go srource in react app in chrome i see my files 
Javascript :: react native cannot make request on localhost 
Javascript :: vue redirect to route 
Javascript :: Moment js get first and last day of current month 
Javascript :: unistall react node package 
Javascript :: javascript calculate days between dates 
Javascript :: node js get ipv4 ip 
Javascript :: jquery wysiwyg editor val acf 
Javascript :: angular ngmodel subject 
Javascript :: javascript map return array with distinc values 
Javascript :: set html attribute jquery 
Javascript :: get array length in jquery 
Javascript :: react material ui input max length 
Javascript :: react-native array.filter by index arrow function 
Javascript :: javascript reload page one time 
Javascript :: jquery get top position of element on scroll 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =