#Hi, How do I change the text of this modal if user checks or unchecks the checkbox?
33 messages · Page 1 of 1 (latest)
That means bulkCompanyService.selectedCompaniesCount is false, so the span shown is correct.
so if i enabled that checkbox
and the user toggles it off, i should be able to see the other text copy
but i am unable to
It's not that you have to enable the checkbox.
checkbox' disbled and the other span you want are boundto the same model property.
If you wanna show that span, that property has to turn to true.
As a side effect the checkbox will be enabled.
It's up to you if that's accepted behaviour or not.
Bound the span to the same property you used for binding the checkbox value: bulkCompanyService.allFutureCompanies
Please read again my message.
the spans are bounded
Please, don't change your code random.
Now you've bound those two span to the same property, and not alternatively.
And that property is still not the one that I suggested to you.
This is what I was tryin to tell you
<p *ngIf="hasAutomationRulesEnhancements; else savingAutomationRules">
Saving this rule will apply to selected companies
<span *ngIf="bulkCompanyService.allFutureCompanies"> and all future companies</span>
<span *ngIf="!bulkCompanyService.allFutureCompanies">and will not apply to future companies</span>.
<ui-checkbox
class="u-margin-top-20 u-block"
[(ngModel)]="bulkCompanyService.allFutureCompanies"
[disabled]="!bulkCompanyService.selectedCompaniesCount">
Apply to all future companies
</ui-checkbox>
</p>
But sincerely, this way of learning is kinda pointless.
You should follow official docs to get the basics of Angular.
g!toh @stable plinth
Hi @stable plinth, welcome to 
We recommend you start your Angular journey with the Tour of Heroes tutorial, located here: https://angular.io/tutorial.
Copy and paste the code you're using now.
morning
If the flag is actually checked, why it should display the "not apply" span?
i want to allow the user to toggle on and off that checkbox
if it's checked, then do not display the not apply span
if it's not checked, displayed the not apply span
And that's exactly what is shown in your screenshot: checkbox flagged and "not apply" NOT displayed.
how can user toggle off the checkbox if it's disabled?
would like to leave that option for the user
The checked state and the value of the checkbox are bound to two different properties.
I can't see your code, but judging by its name bulkCompanyService.selectedCompaniesCount should be a number, so considering you bound disabled state to its negative, that means the checkbox will be disabled whenever that number is 0.