Hello,

Looking at the code below. 
I'm trying to enter a default value with this line of code 
*controlerSeverity:[2,[]],* but i like to make this value more dynamic so 
rather then hard code the value in this example the number two can I not 
substitute a variable (second example code)



This works:
 buildDetailsForm() {
    this.DetailsForm = this._fb.group({          
     incidentDescription: ['', []],
     *controlerSeverity:[2,[]], // hard coded value works*
     createdBy:['',[]]
   });
    }

This does not work, how come?
testValue = 2;

 buildDetailsForm() {
    this.DetailsForm = this._fb.group({          
     incidentDescription: ['', []],
     *controlerSeverity:[this.testValue,[]], // can i not use a variable in 
place of hard coding for example a number??? as of now this wont work.*
     createdBy:['',[]]
   });
    }

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to