Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

angular readonly 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
     formControlName="userName"
     matTooltip="Enter User Name"
     matInput
     placeholder="User Name"
     required
     [readonly]="this.readOnly"
    />
Comment

PREVIOUS NEXT
Code Example
Javascript :: create an array of numbers by numbers range in angular 
Javascript :: como remover uma variável de um json 
Javascript :: mui theme remove shadow 
Javascript :: javascript simulate key press 
Javascript :: brand icons in next js 
Javascript :: js add string to beginning of string 
Javascript :: javascript set input value by class name 
Javascript :: javascript get last character of string 
Javascript :: how to click button programmatically in jquery 
Javascript :: image background full width react 
Javascript :: javascript clone class prototype 
Javascript :: javascript loop through object values 
Javascript :: jquery get data-id 
Javascript :: put two buttons in a row in react native 
Javascript :: javascript week day name 
Javascript :: javascript string first letter lowercase 
Javascript :: local storage check max size 
Javascript :: remove last two elements array javascript 
Javascript :: split by whitespace javascript 
Javascript :: useRoutes exact path match in react 
Javascript :: missing from-clause entry for table sequelize limit 
Javascript :: how will it look when there is a container inside a a row bootstrap 
Javascript :: getting the distance fo an element from the top jquery 
Javascript :: javascript style text decoration 
Javascript :: remove time from date in node js 
Javascript :: get url query params js 
Javascript :: jquery select change get selected value 
Javascript :: initialize json array 
Javascript :: how to insert image by javascript 
Javascript :: javascript current time 
ADD CONTENT
Topic
Content
Source link
Name
1+3 =