| 1. |
Explain The Purpose Of Constructor() In Aurelia? |
|
Answer» Constructor METHOD is used for initializing object CREATED with a CLASS. This method is called first. If we don't specify this method, the default constructor will be used. For example here we are initializing teh counter property to 1 inside the constructor. Later we can use this in the view and display the value as 1 like ${counter} Constructor method is used for initializing object created with a class. This method is called first. If we don't specify this method, the default constructor will be used. For example here we are initializing teh counter property to 1 inside the constructor. Later we can use this in the view and display the value as 1 like ${counter} |
|