'Performing logic on input attribute
Is there a way to perform checks on input attributes like you can for forms? https://angular.io/guide/form-validation
I'm trying to get the "Enter a small number" text to appear if a number larger than max was typed
<div class="ui input right labeled">
<input type="number"
placeholder="{{ vm.object.objectTitle }}"
step="any"
min="1"
max="1000"
ng-model="vm.object.model"
ng-change="vm.inputChanged()"
name="inputFieldName">
</div>
<div ng-if="inputFieldName.$error.max"
style="color:red">
Enter a smaller number
</div>
Solution 1:[1]
Since my comment probably requires at least some pseudo code to be understandable, here we go.
Note that I just reused your existing vars and loops in the question without knowing if they actually do the job. So you may still have some bits and pieces to fix.
- keep your
create_user.ymlandadd_user_to_group.ymlas they are if your really want to keep them totally independent. (You can always move those tasks to the next file later if you feel your design is too complicated) - create a
create_and_add_user_to_group.ymlfile with the following tasks:--- - name: Include create user tasks include_tasks: create_user.yml - name: include add user to group tasks include_tasks: add_user_to_group.yml - In your main task file (playbook, role, etc.....) add the following task:
- name: Create user and add to group include_tasks: create_and_add_user_to_group.yml loop: "{{ userslist | flatten(levels=1) }}" vars: userslist: - "{{ ['users'] | product(users) }}" loop_control: loop_var: tasklists
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
