All Questions
Tagged with angularjs-ng-if angularjs-directive
13 questions
0
votes
2
answers
238
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
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
105k
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
59k
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. ...
0
votes
1
answer
225
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
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">
...
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)!=...
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 ...
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 {
...
0
votes
0
answers
460
views
display or hide loading from multiple controllers
I'm trying to create a generic loading that would be shared among controllers. So, I've created a service that will control the hide/show state:
(function () {
'use strict';
var module = ...
2
votes
2
answers
234
views
Accessing DOM elements in directive after ng-if compiles
I am trying to build a side navigation menu, but want to dynamically populate its items based on the state of the DOM (i.e. <section>s in my DOM).
However, I have some ng-ifs applied to various ...
1
vote
1
answer
97
views
Order AngularJS directives are created not as I understand from the documentation
I have an AngularJS app where I have to traverse some of the elements with the cursor keys. To do this I created a directive called selectable that adds some info to a list in a service when the ...
0
votes
0
answers
358
views
Angular directive with ng-if inside another ng-if not working
Here is the directive:
<a ng-if="field.bindingType == 'options'">
<select ng-model="field.value" {{html}} >
<option ng-repeat="(k,v) in field.options" value="{{k}}">{{v}}</...