Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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"
   />
 
PREVIOUS NEXT
Tagged: #angular #null
ADD COMMENT
Topic
Name
6+7 =