Questions tagged [angularjs-directive]
AngularJS directives are a way to teach HTML new tricks by extending the HTML vocabulary. Directives allow you to manage DOM elements in a declarative pattern, freeing you from low level DOM manipulation tasks.
17,492
questions
0
votes
0
answers
10
views
AngularJS: How to access factory methods from a directive template?
I have a factory that just returns a bunch of config values, something like this:
angular.module('myApp').factory('configService', function (settings) {
var serviceObj = {};
serviceObj....
0
votes
0
answers
34
views
ERROR TypeError: this.authService.injectAuthHeaders is not a function
I am getting following error
Issue is i have a abstract class which is not getting injected, i dont know how to inject abstract class.
looks like the issue is the abstract class AbstractHubService (...
1
vote
1
answer
74
views
Why do Ionic Lifecycle hooks (ionViewWillEnter, ionViewWillLeave) not fire when used as HTML Selector?
I am working on an Angular Project, with Ionic 4.
When Child Page is called from Parent Page's HTML using HTML Selector, child page's Ionic Lifecycle Hooks do not fire.
Why is it so? How do I use ...
-4
votes
0
answers
25
views
How to pass a parameter to an attribute directive in Angular 12?
I am creating a directive to change the font color of the text. My requirement is that I want to use that directive in 2 different places. So the color for the texts are going to be dynamic based on ...
1
vote
0
answers
23
views
What would be your representation of a particule as an angular directive
I believe, the answers will provide nice and complete examples of angular's directives and also different points of view of actual understanding about particules. It applies to Angularjs and Angular ...
0
votes
2
answers
38
views
How to check if a website is built on Angular or Angularjs?
for any website, on the browser, how to know if a website is built on Angular or Angularjs?
0
votes
0
answers
37
views
Why when I update the ForGender to "Women" all the next rows become Women on modal even if the value is Men?
When I click the update button on the 1st row a modal will show up. I try to update the ForGender from Men to Women. The problem is when I try to update the next row (2nd row) and the rest of the row ...
-3
votes
0
answers
24
views
Ng Multiselect dropdown displaying black box in the dropdownlist
I am using multiselect dropdown in my angular HTML code. I am getting a black check box in the dropdown list.
whats happening here?
0
votes
0
answers
18
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
15
views
Data not getting parsed in custom directive for angularjs
I have created a custom directive where i am parsing information using data attribute but value of data attribute is null.
Directive invoke code:
<processInfo data="{{self.processInfo}}" type="...
0
votes
0
answers
30
views
How to make Chain multiple RxJS observables subscribe angular 8?
I work on angular 8 i have multiple subscribe
i need to make Chain multiple RxJS for getactivesession
and after that subscribe PostUpload .
What I have tried:
this._dataService.getActiveSessions(...
0
votes
0
answers
12
views
AngularJS Ui.Bootstrap Pagination not working
I have a table I would like to have pagination using AngularJS as well as UI.Bootstrap. However, my UI.Bootstrap pagination directive does not seem to be working. It shows as an element on the page, ...
0
votes
1
answer
22
views
Attribute undefined in custom directive in angularjs
I am creating a custom directive in angularjs, but for some attributes i am receiving undefined value.
function processinfo(ProcessInfoService, $timeout) {
console.log("processInfo ...
0
votes
0
answers
11
views
angular-ui-tree expand on hover not working
I'm using angular-ui-tree recently, and trying to use it's data-expand-on-hover function. Unfortunately it's not working for me, or I'm using it wrong (what's more likely).
Directive:
https://github....
0
votes
1
answer
26
views
how to pass parameters in angularjs custom directive for function call
This is my code snippet -
<my-wizard
on-finish="doFinish()"
I am calling on-finish from my-wizard's controller class.
It works and doFinish() gets invokes.
I want to pass some ...
0
votes
0
answers
51
views
HostListener listening for clicks even if div is closed
I have created a Directive, that listens for clicks outside of the div:
click-outside.directive.ts
@Directive({
selector: '[clickOutside]'
})
export class ClickOutsideDirective {
constructor(...
0
votes
1
answer
22
views
AngularJS ng-class updating content
I've got some code in AngularJS here working half percent (I will explain) :
<button ng-class="{'svgMinus-dark': isDarkTheme, 'svgMinus': !isDarkTheme}"></button>
I also tried ...
0
votes
2
answers
29
views
How to find which function or event is getting triggered on change of value on the select box in the below code
<p>${Agenda Items Widget}</p>
<div id="pending-agenda-item-widget" class="panel panel-default" role="region" tabindex="0" aria-label="${...
0
votes
2
answers
31
views
What is the difference of ".. let i = index" and "..let i as index"?
I am new to angular and I've been watching some youtube videos. Some of them use "let item of items; let i as index" and another one use "let item of items; let i = index". I tried ...
0
votes
1
answer
18
views
How to use controller with custom directive in AngularJS?
Let's say I am using a custom directive named my-form-data:
<my-form-data info='infoObj1' template="ssc.html"/>
<my-form-data info='infoObj2' template="college.html"/>
...
0
votes
0
answers
13
views
Is it possible to externalize AngularJS directive controller?
Here is a directive in HTML:
<wizard>
<wz-step template="start.html"/>
<wz-step template="end.html"/>
</wizard>
Directive implementation:
...
0
votes
0
answers
24
views
Angular js adding attribute directive from another directive
Pretend I have this:
<span ng-bind="value" my-dir my-dir-param="value"></span>
So my-dir is a custom directive that adds another directive to an existing element.
I ...
-1
votes
1
answer
29
views
how to right test cases of switch cases using angular
I have a situation where I want to write test cases of this code using angular , please help
export type Browser = 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'Unknown';
export function detect(): Browser {
...
0
votes
2
answers
58
views
Angular how to wrap input value with double curly braces
What I want to achieve is that when I write inside input field "Foo"
it will become {{Foo}}
0
votes
1
answer
38
views
How can I call a method within an AngularJS directive from within a controller
This might be a simple question but I'm updating some old AngularJS code and my knowledge is a bit rusty.
If I have an AngularJS directive, like below:
As you can see I have a reload method in there. ...
0
votes
0
answers
14
views
AngularJS using ngRequired without using ngModel
I'm currently maintaining an AngularJS application and need to have html inputs use the ngRequired directive. However these inputs do not use ngModel-- just straight up value to display the value ...
0
votes
0
answers
32
views
NSwagStudio nswag command line does this support TSlint / ESLint?
Is possible to generate an Angular code to match with ESlint/TSLint standards
https://github.com/RicoSuter/NSwag
0
votes
0
answers
120
views
Country Code+Phone Number Custom Validator and Directive not showing mat-error for Template Driven Form Angular 13
Error message does not show even when the validator returns with true, I can confirm this because the submit button gets enabled when the phone number is correct but gets disabled when incorrect.
Here ...
0
votes
2
answers
21
views
Manipulate an element that is conditionally rendered
I'm fixing a bug on some legacy Angular 1.5 code.
I have a template like this
<div id="container" ng-if="ctrl.show_container">
<div id="child"></div>
&...
0
votes
1
answer
16
views
Show word count after three words?
I am calling data from api in angular and it is a multiselect option what I want is if data is more than three words its should show count of remaining entries how can I do this can anyone help?
0
votes
1
answer
34
views
AngularJS D3JS Donut chart colour change of arc on hover
I am creating donut using d3.js with AngularJS. Here is my Donut, by default I need to have same color for all the arcs of Donut chart, which is working fine. Now on hover of the particular arc I ...
0
votes
1
answer
7k
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
8k
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
0
answers
63
views
How to call AngularJs Directive function from Vue Component - Vue & Angular Js
I am having test.js file as follows,
import angular from 'angular';
angular.module('frontendApp').directive('test', ['$rootScope','$timeout', function($rootScope, $timeout) {
return {
...
0
votes
0
answers
21
views
Angular js - Wait for elements to finish
So, I'm kinda new to Angular js and I'm working on a legacy website that uses it and I have this Angular Directive that essentally injects svg markup for each element in a menu. In this directive I ...
0
votes
0
answers
48
views
angular.min.js:117 Error: Could not resolve 'create' from state ''
Hi I have created a angularjs+webix project wherein I will be adding CRUD operations.
I have a app.js file where I put the routing:
var app = angular.module('app', [ "webix", "ui....
0
votes
0
answers
27
views
Custom directive is not updating ngModel value
I have a edit page form, where I wanted to achieve is that, when the form is loading with existing values if the values have some special characters the input fields will remove them while loading the ...
1
vote
2
answers
58
views
How to prevent a component from starting/rendering when the required parameters are not filled correctly?
Say I have a component and I have bindings that are not optional, like so
angular.module("foo").component("fooComp", {
bindings: {
notOpt: "<",
},
...
0
votes
1
answer
84
views
Function calls are not supported in decorators but 'CountdownTimerModule' was called
I am trying to build production files, however aot is failing with this error message:
Function calls are not supported in decorators but 'CountdownTimerModule' was called.
I am building with npm run ...
0
votes
1
answer
52
views
Angular js Directive to Fire "click" event on pressing enter key on ANY element
I need to fire the click event using the enter key using a directive. I need it to be a directive because I would like to reuse it.
Ex: A div which has some onclick events bound to it, I will set ...
0
votes
2
answers
191
views
Angular after click add active class and remove from siblings
Using component for list how to add active class and remove it from siblings.
In main component HTML:
<app-item-desc *ngFor="let itemDesc of addedItem; let i = index" [itemlistDesc]="...
1
vote
0
answers
52
views
Multiple files upload using AngularJS and Spring Boot
I am trying to upload multiple files at a time using Spring Boot and AngularJS.
Spring Boot file
@RequestMapping(value = "/fileUpload", method = RequestMethod.POST, consumes = MediaType....
0
votes
0
answers
29
views
$modal is not open for the second time in Angularjs
$modal is called in the $ngonint hook. First time when controller loads, it works perfectly. But for the second time, it is not showing up when the controller loads.
Expectation:
Consider two ...
0
votes
0
answers
14
views
Ionic + Angular
Help please,
I tried to fix it without success. I'm using Ionic framework and Angular. I have a form which is opened when I click on a Sidemenu. So the problem is when I add a formControllerName on ...
1
vote
3
answers
1k
views
Trying to set environment variables in appSettings.json - Angular and Typescript
I am basically trying to set the API URL path in appSettings so I can change back and forth from prod and dev environments easily.
This is my appSettings.json file. apiURL is the variable I am trying ...
1
vote
0
answers
24
views
Typeahead field is not displaying non-english characters in Angular JS
I am using typeahead field in angular js which is displaying data consumed from a web-service. The non-english character 'ô' is not being displayed correctly in UI. It is being displayed as '?'. How ...
0
votes
1
answer
24
views
HTML ng-controller (dropdown menu) working locally and on JSFiddle but not on Google Sites
My HTML website with ng-app is working locally and on certain coding websites like JSFiddle and CodePen, but not on Google Sites, Github, W3, etc.
The intention is that you can choose a language (...
1
vote
0
answers
25
views
round off the amount if checkbox is checked
if the checkbox is checked the total amount should be roundoff. if the checkbox is unchecked the total value in decimals in angular js
tell me from starting, I didn't start
$scope.checked=?
0
votes
1
answer
38
views
AngularJS : prevent location change on back button or move cursor
Want to prevent from reload or move back to history urls
stop back button from browser on particular component
Note : only for angularJS not Angular(2..12)