92 questions
0
votes
1
answer
100
views
Template Referencing not happening when origin has a *ngIf
<mat-icon
#suggestionIcon="cdkOverlayOrigin"
class="suggestionIcon"
*ngIf="part.highlight"
(click)="openOverlay()"
cdkOverlayOrigin
>
...
0
votes
2
answers
248
views
ng-if or ng-repeat in angularjs remove web-components from DOM
I have 14.2 angular and I need to reuse components from angular in the legacy project in angular js (1.8.3) using web components.
I have two examples:
https://stackblitz.com/edit/angularjs-with-...
0
votes
1
answer
477
views
How to show and hide the calendar based on condition in angular
I have an angular application in that I need to show the caledar based selected dropdown list.
.component.ts
OptionList: LookupActionCode[]=[];
public setList(actionType: any):void{
this....
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
1
answer
106k
views
ng-keyup firing but not reading properly when used with an ng-if inside a directive template
I have a directive and it works fine in a way such that when I type something the search() scope function inside my directive fires and sets $scope.query with the input text.
here is the directive ...
1
vote
1
answer
61k
views
directive with ng-if not rendering in Angular.js
I'm trying to render a directive whenever I get the search results back. My plan was to keep a scope variable algoliaSearch initially false and whenever I get back search results I change it to true. ...
-2
votes
1
answer
43
views
How can we write this in <div ng-if= " ". the like expression and everything else
(( (table1.field1 like 'HR%') OR (table1.field1 like 'ABC%' OR table1.field1 like 'XYZ%') ))
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
655
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
3
answers
4k
views
Why do ng-if don't work inside a mat-dialog
I have created a mat-dialog component to fire for http response. When I include a ngIf statement inside the html for the mat-dialog,it is not handled. On the console it shows a warning as follows.
Can'...
1
vote
1
answer
43
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
322
views
AngularJs UI Bootstrap dropdown position is miscalculated while adding ngif for dropdown-menu
AngularJs UI Bootstrap is miscalculating position of dropdown while adding ng-if condition for ui element holding 'dropdown-menu' class.
AngularJs UI Bootstrap version - 0.3.13
AngularJs version - 1....
0
votes
3
answers
848
views
Angularjs: Why does it execute function in ng-if when I click on table row?
I have code on https://jsfiddle.net/8t45enfg/2/
The source code is quite simple, suppose the array list have only one element
HTML code:
<div ng-controller="myController">
<table>
...
0
votes
1
answer
226
views
Using ng-if with directive take to much time [Slowly]
I have a directive tree list view with checks box, (aleardy developed by another developer), i want to display it to the user when he clicks on button, so i used ng-if/ng-show/ng-hide/ng-class with ...
0
votes
1
answer
343
views
How to show a <span> element for each rows clicked in angularjs
I just want to make the marked and unmarked icon of each below appear based on the response from the server. I've read series of relevant questions but all seems to be ng-class related, I tried to ...
0
votes
1
answer
167
views
ng-if does not work when placed outside of controller and $compile-ed with scope, but ng-show does
I have a plain angular application which adds variables to the scope and simply display them. Which is simple and working.
But there is a part of the page that does not run in angular (practically it ...
0
votes
1
answer
51
views
Skip duplicated items while ng-repeat
There is a nested array which consist of bundles and those bundles in turn have items. So, I want to skip identical item(s) of the next bundle based on previous bundle items while iterating. Below is ...
0
votes
0
answers
742
views
Add font-awesome icon to one option in select created by an ng-repeat
Is it possible to add an icon to an option in a dropdown based on if it matches a certain setting from the data returned in an ng-repeat?
I have the following select and the options within that ...
0
votes
1
answer
105
views
AngularJs 1.x not updating the visibility of element with ng-show or ng-if either
I am facing issue with the angular js 1.x not updating the visibility of the element even when variable values are detected. I am using custom angular open-close symbols but I don't see this as an ...
0
votes
1
answer
342
views
Bootstrap tooltip : hide tooltip if binding variable value is null
I'm working with angularJS and haml syntax and I want to hide the tooltip on mouse hover if an attribute is null, this the line that show it :
%td
%a{ ng_href: '/reports/{{...
0
votes
1
answer
47
views
Correct use of ng-if directive in html
I've following html code snippet where I would like to use some "ng-*" directive to conditionally apply color to the text.
1 <div class="checkbox" ng-repeat="todo in todos">
2 <label>
3 ...
0
votes
1
answer
730
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 ...
1
vote
1
answer
637
views
Browser freezes when use function api in ng-if AngularJS
I use angularjs and I have a problem with ng-if when I use a function that returns true or false in two API, the browser is freezes
self.isShow= function() {
service.getKioskLogByKioskId([...
0
votes
2
answers
2k
views
Angular ng-repeat with ng-if not working on tr tag
In the below Div i am using ng-repeat across some data to populate a list. while doing this i would like to NOT have a a certain TR tag created if it fits a certain requirement by using the ng-if ...
0
votes
0
answers
279
views
Angularjs : add multiple ng_if condition in with haml syntax
I'm working on an item_selector directive, I want to add an indicator for archived element, this is the item selector template .haml :
.directive-items-selector{ ng_click: "openItemsSelector( $event ...
0
votes
0
answers
160
views
Allowing multiple directives to transclude in a recursive template
I am currently receiving a tree of managers and their subordinates from the back end. I'm using a recursive template to display this.
<script type="text/ng-template" id="managerTmp">
...
-3
votes
2
answers
855
views
Angular 4+ : Why isn't ng-if working in app.componet.html?
I am currently trying to use an ng-if directive in my app.component.html file:
<p>This should appear.</p>
<p ng-if="0==1">This shouldn't, but it does.</p>
My app.component....
-2
votes
1
answer
562
views
Angular change template element based on the radio button
I have two radio buttons in my template. on selecting a button, different input text fields should be displayed for each button and the other fields should hide.
How can I do this using Angular?
I ...
1
vote
1
answer
908
views
Rendering partial views based on an ngif statement in pug (jade) and angularjs
Is it possible to have 2 separate .pug files be the result of an ng-if statement in a parent template? Something like
ng-if({booleanVar ? pugFile1.pug : pugFile2.pug})
Or any way cleaner than having ...
2
votes
0
answers
384
views
In Angular2+ which one has the better performance? Using dynamic components or multiple *ngIf
I'm working on a data grid module. In the grid cells I need to display several types of data. So every cell is a component. Currently I'm using a ComponentFactoryResolver to generate the cells. ...
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
208
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
0
answers
365
views
angular2 ngif not working
I have a div in my HTML and i want to show it when a file is uploading.
its a simple *ngIf but somehow its not working :(
HTML
<div
*ngIf="loading"
style="width: 100%;height: 100%;
...
0
votes
1
answer
557
views
AngularJS getting value from function in ng-if and using that value in element
My question lies in the following code. Though the code is not working now. I wan't to rewrite it in proper way so that it works.
<span ng-if="community = vm.getCommunity(invite.community_id)!=...
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
553
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
551
views
angularjs if else condition does not work
i am new in AngularJS and working on a small module in a project. I want to show two div based on condition. The condition is if {{ merchandiser.popCode }} means popcode value exist in database then ...
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
1k
views
Can I use ng-click with ng-if to hide and show two different sections simultaneously
I'm working on an app in angularjs and trying to do something directly in the DOM. While I know this is not the greatest practice, it would be pretty practical in this case since I'm specifically ...
0
votes
1
answer
796
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)) ...
1
vote
2
answers
4k
views
Using value of ng-model in ng-if
I have a text box where I enter an idNumber. I want to check if that id number appears in my table. If it does, I want to add a glyphicon to that row.
Now, my problem is that I don't know how to ...
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/...
0
votes
1
answer
7k
views
How to compare dates using ngIf in angular 2 and update the card background accordingly?
I have "md-grid-list" to display cards in the grid. I am looping my array of data using "ngFor". How to compare each of the datetime element in the array with the given DateTime using "ngIf"? and if ...
1
vote
0
answers
643
views
Again: ng-click not working inside ng-repeat inside ng-if
This is most likely going to be another Angular scope question. I looked hard for a solution on SO, however, nothing I found would solve my problem.
I am using Angular.js together with Swiper.js. ...
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
795
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 ...
0
votes
2
answers
196
views
Trying to shorten check conditions using or in ng-if directive. Comparing series value with multiple times as there are many values to check in or
<img src="img/temp.png" class="img-responsive" ng-if="series === 'Temperature' || series === 'T' || series === 'Temperature-138828'">
I tried like this, but it didn't work:
<img src="img/...
1
vote
1
answer
371
views
Error using array function in ng-if
This sounds very simple but I have been struggling with it!
In AngularJs 1.4, I have an ng-if which is using array's some() function. I get syntax error
Syntax Error: Token '>' not a primary ...
0
votes
1
answer
101
views
Directive under ng-if doesn't get recompiled when inserted in DOM
Here's an example which demonstrates the problem described in the title: https://plnkr.co/edit/Xn1qgYftc5YHMsrGj0sh?p=preview
Directive code:
.directive('translate', function($compile) {
return {
...