All Questions
Tagged with angularjs-ng-if javascript
33 questions
0
votes
0
answers
79
views
AngularJs form validation not working with ng-show
I am struggling with ng-show and $invalid logic, my requirement is very simple I need to make a form that will show input fields based on conditions.
I need to add one datetime picker of moment.js.
...
0
votes
0
answers
105
views
If one element active then not show another one Angular JS
I am working on AngularJS project. It's a store that has a search bar and profile, cart icon near it.
When I click the search bar, it extends to the right and overlays the right icons. And when it ...
1
vote
1
answer
651
views
AngularJS ng-if variable works only once
I am maintaining a code written some time ago, I have no experience in AngularJS. I have to turn on a spinner while an HTTP request is fired and to turn off it when the HTTP response is received.
The ...
1
vote
1
answer
40
views
Ng-if: using plain expression instead of function call, does it make a difference?
I couldn't find an answer so I'm bringing it up here.
Does it make a difference in resources or performance if I use
$scope.isAllowed = true;
<div ng-if="isAllowed"></div>
...
0
votes
1
answer
725
views
AngularJS ng-hide/show label/button if length(description) < 20
I need to show/hide label if length(description) < one row. Code is working ok, but if length < one row, label isn't hide. How to hide/show label?
If [[ demandAd.description ]] less than one ...
0
votes
1
answer
386
views
ExpressionChangedAfterItHasBeenCheckedError . Angular 2(5) *ngIf
I'm using a service to pass data between child and parent with the purpose being to update the parent ui with child specific info depending on what child is loaded.
Service:
import { Subject } from "...
0
votes
2
answers
205
views
confusion while using ng-if / ng-show / ng-hide
I have few div's inside my html. I am exporting the content to the PDF and PDF is downloaded when user click on he export button. I want few div's content not to be exported/shown inside the PDF but ...
0
votes
1
answer
36
views
Not validating new controls after submitting form in angularjs
We have a form which we are submitting on save button. There are some validation firing on save. We are submitting form using $scope.isSubmitted= true and $scope.watch on $scope.isSubmitted for error ...
1
vote
1
answer
549
views
How to get nested ng-if triggering?
If I have a ng-if inside an ng-if, the inner ng-if won't initiate if the condition on the outer ng-if is in the process of hiding.
I'd like the embedded ng-if to trigger even if the outer one is in ...
1
vote
2
answers
2k
views
Show a link based on a condition in angularJS
I'm creating a navigation bar in AngularJS.
I am showing and hiding the submenu 'div.farm-links' on mouseover and mouseleave respectively on 'div.menu-links'.
Now, in my submenu whenever 'child....
0
votes
1
answer
794
views
Angular 1/ ng-if one-time binding only in a condition
In my template i have :
<div ng-if="$ctrl.show()">
<input class="form-control" type="text">
</div>
In my component
show() {
if (angular.isDefined(this.parking.parkingType)) ...
0
votes
1
answer
1k
views
Angularjs 4 - Need to refresh for display/hide directive
I have a problem to hide the navbar when the user is not logged in (on the public views), I check if the item currentUser exists on the localStorage and then I use
*ngIf on the html template to show/...
3
votes
4
answers
8k
views
Using ng-if to show certain things if condition is met
I'm trying to use ng-if to show certain rows if the condition is met, but can't quite seem to get it to work 100% correctly.
<div style="margin-bottom: 1em;">
<h4><!-- content ...
0
votes
2
answers
1k
views
ng-if not working with simple javascript
ng-if is not working when I change the values through simple javascript function.My function is getting called but the changes in values cannot be seen in view. Please refer below code.
HTML
<div ...
4
votes
1
answer
786
views
Why is ngif ignoring priority level?
I have created a custom directive with a priority of 1000. In the directive's compile function I am removing ng-if from the element. My assumption is that since ng-if has a lower priority of 600, it ...