To set the maximum number of letters for textarea, we achieve this by writing:
<textarea maxLength="50"></textarea>
but could i do something like below? Is there any way?
import { Component } from '@angular/core';
@Component({
moduleId: module.id,
selector: 'app-create-offer-page',
template: `
<textarea maxLength="textareaLength"></textarea>
`
})
export class CreateOfferPageComponent {
textareaLength: number = 50;
}
I ask because it does not work.
elzoy source
share