In 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.
1
vote
2answers
27 views
Angular JS - NG-Repeat with filters and groupBy
I am building a dashboard to display ogoing and closed issues. I got everything working with angular's ng-repeat with filters and grouped by date. Here is a quick sample of what I got so far:
<div ...
0
votes
0answers
16 views
Angular - change directive input not trigger digest
My app contain 3 directives:
angular.module('mod').directive('directive1', function() {
return {
restrict: 'E',
controller: 'controller',
templateUrl: 'tpl1.html',
...
0
votes
1answer
18 views
angular directive for post DOM load
I'm sort of a beginner to angular and needing help constructing a directive for post DOM load.
I have this script below functional, but it uses a timer. I'd rather have something more robust insuring ...
0
votes
2answers
19 views
What are the pros and cons of ui-sref?
I'm starting to work on a legacy project using Angular 1.5 and it uses both href and ui-sref.
I don't really see the point of using the latter, especially for top menu.
Example
menu.html
<a ui-...
0
votes
1answer
20 views
change in custom directive ngClick event/function
i have a custom directive that i need to insert some login, basically i need in my custom directive prevent from being fired a function in ngClick, than depending in some logic that is made i will be ...
0
votes
1answer
22 views
ng-click event with a promise
i have a angular app, that basically haves a directive that show the content depending the type of user, in case that your accountType is free it whos you a wizard modal giving you some promotional ...
2
votes
1answer
47 views
Directive is being called only once
I have created a custom directive that goes inside my input field. The purpose of this directive is to analyse the values/data inside the Inputfield. This directive is supposed to be called everytime ...
1
vote
0answers
15 views
jQuery Rateyo rating plugin integration with AngularJS
I am trying to integrate the Rateyo plugin with AngularJS and getting problem in defined rating value from directive, following are codes:
Controller
var app = angular.module('myApp', []);
app....
0
votes
1answer
24 views
Using ng-model-options with ngModelController
I am trying to delay validation of an custom textbox component. I only want to validate the input on blur. The existing component does not use ng-model inside the input but uses the ngModelController ...
2
votes
2answers
32 views
ngModel undefined when using directive - Angularjs controller
My ngModel is undefined when using the ngPattern directive. If I remove ngPattern, the ngModel works as expected. See plnkr.
Note how vm.condition does not show when typing a value in the text box, ...
0
votes
2answers
29 views
getting data from angular modal service
First type questioner, long time reader. Newbie to Angular.
I am trying to create a popup modal for expanding a text box. (If you have ever dealt with Access, think shift F2). So, I have a form ...
0
votes
1answer
23 views
Trouble with executing Angular directive method on parent
I have a directive inside a directive, and need to call a parent method using the child directive. I'm having a bit of trouble passing the data around, and thought y'all might have an idea.
Here's ...
1
vote
2answers
27 views
Angular Directive to component angular 1.5
I have this directive, that i would like to make a component
angular.module('app')
.directive('year', function () {
var controller = ['$scope', function ($scope) {
$scope.setYear = ...
0
votes
0answers
16 views
AngularJS 2 Alternate StyleUrsl/TemplateUrl
I have a component where I'm trying to inject a different styleUrl or templateUrl based on an object that is initialized when the component loads.
@Component({
moduleId: module.id,
selector: 'my-...
0
votes
0answers
21 views
Global Exception handling in angular js using promises : Exception handling: $q promises not catching Error code
I have plan to implemented the Err handling service globally for my existing application. I am not send the error code from server. so i have plan to implement the Error code in angular by using ...
0
votes
1answer
19 views
AngularJS - How to unsynchronize $viewValue and $modelValue in directive
I am using Angular JS 1.5.6 and I would like to programmaticaly unsynchronize $viewValue and $modelValue, I want $viewValue to keep its current value but $modelValue to be set to undefined. I tried ...
0
votes
0answers
14 views
Concatenating directive attribute to template?
Is there a possible way to use the value of an attribute and use it to concatenate in the directive template
<text-input txt-info="textName" ng-model="pi.medRecNumber"> </text-input>
...
0
votes
0answers
12 views
angularjs datatable is not working while using datatable='ng' searching and pagination
My Controller
.controller('BankaccountViewController', function($scope, $uibModal, $log, $location, $routeParams, $timeout, DTOptionsBuilder, BankaccountService) {
$scope.dtOptions = ...
0
votes
0answers
26 views
sorting a json array programatically
This is th json, this need to be filtered based on the "testType" equal to 'R' also had to sort based on "createdDate"
{
"code": null,
"message": "Total 1 records found",
"result": {
"size"...
0
votes
1answer
24 views
How to redisplay directive after Javascript function executes
I have an AngularJS Directive defined in a Javascript file that looks like this:
(function () {
'use strict';
angular
.module('ooApp.controllers')
.directive('fileUploader', fileUploader);
...
2
votes
1answer
19 views
Pass rendered string into Angular directive
I am trying to make an angular directive that renders dynamic content urls based on an attribute placed on the directive. Example:
Directive:
angular
.module('myModule')
.directive('...
1
vote
0answers
20 views
how to open API services call to a new window?
I try to open the API service call to a new window tab but tried to use window.open() and it doesn't work. I also tried to put the ng-href="URLwithParam" in the HTMLtemplate with target="_blank". I'm ...
0
votes
1answer
32 views
Call link function directive Angular 1 ES6
I create a directive based on ES6 style:
export default class myDirective {
constructor() {
this.restrict = 'E';
this.scope = {};
this.link = link;
}
link() {
...
2
votes
1answer
26 views
navigation does not work with ng-if condtion
hi i need help from you guys, when i add in ul with ng-if condition navigation does not work, how to solve this please help
<nav id="menu" class="nav-main" role="navigation">
&...
0
votes
1answer
42 views
Controller and directive variable's scopes
I'm new to AngularJS. I've started learning it from basics and began doing the simplest examples and the custom ones. Recently I've found some strange behavior of AngularJS.
I have the following code ...
0
votes
0answers
22 views
AngularJS - Custom validation directive crashes input[number]
In my case, when i move angularjs the slider, new value (value1) is calculated according to the slider value and new value is written down.
But new value should not be greater than value2.
My custom ...
2
votes
0answers
28 views
How to use $compile inside an AngularJS link function with a $watch
Using AngularJS and Angular-UI Tooltip (uib-tooltip) to setup a tooltip system that allows the user to turn the tooltips on & off. I'd also like to keep the text in a central location for easy ...
1
vote
1answer
22 views
angularjs form validation showing success on page load
I have a function in my controller to validate if maximum of three choices are made out of available checkboxes and one free text area. The user can either choose three checkboxes and leave the text ...
0
votes
0answers
16 views
angular material not working / css is not applying
Here is my index.html look like. I put all angular material js and CSS in my css,node_modules folder.
<html>
<head>
<link href="img/favicon.png" rel="icon" type="image/x-icon" /&...
0
votes
1answer
25 views
Angular recursive template
I have a directive with an item template that recursively references itself but is not properly rendering out children beyond the first level. I've looked at several examples and it seems my example ...
1
vote
1answer
22 views
Angular directives collision
I would like to use 2 directives in the same app. The problem is that when I use the second one, the first one crashes with an ugly error: TypeError: Failed to execute 'getComputedStyle' on 'Window': ...
0
votes
1answer
21 views
How to pass value from custom directive to html page which is in templateUrl
I have written a standard code to write the custom directive which displays the page defined in the templateUrl, and its working good with the code shown as below.
Now I want to pass variable with ...
0
votes
0answers
24 views
Working with null/undefined dates in an Angular multi-input date directive
I'm setting up an Angular (1.5) multi-input date input directive. It works fine for updating an existing date, but when the model it's trying to update isn't defined yet, or is null, I'm not able to ...
0
votes
2answers
37 views
What happened to the directives property in the Component decorator for Angular 2?
I am using the Angular CLI v1.0.0-beta.19-3 to scaffold/build an Angular 2 website. I generate my component as follows ng g component file-upload.
I noticed that the generated component file-upload....
0
votes
1answer
21 views
Watch directive scope not working
Context
My controller stores an array. When pressing a specific shortcut on the keyboard I add a new object to this array.
The array is used inside a directive to display a chart.
So, on shortcut ...
1
vote
1answer
8 views
wrap md-list-item in custom directive
why i can't wrap an md-list-item in a custom directive ?
Original html
<md-list class="md-dense">
<md-list-item ng-repeat="user in items">
<img ng-src="{{user....
1
vote
1answer
21 views
Optimizing code in angular directive
In angular directive init function i am declaring constant and utilizing the constant in html. I have multiple directives utilizing the same constant i want to keep the constants a reusable one.
In ...
0
votes
0answers
27 views
Kendo treeList using angular directive creating a memory leak
I am using mutliple Kendo treelists in my app so I have a directive to create them, they all run fine except for one that holds a lot of data.Each node in the tree has an ng-model and ng-click on it ...
0
votes
0answers
16 views
How can I make an AngularJs directive work at a specific screen size
I have this directive that adds and removes a class to a header section when I scroll the page, a hide/show header. I would like to have this directive work only on a screen size less than 600px. Any ...
0
votes
1answer
13 views
angularjs directive currency formatting according to chosen translate language
I am formatting the a number in the format of currency, with decimals and comma/point to mark the thousands.
app.directive('format', ['$filter', function ($filter) {
return {
require: '?...
0
votes
1answer
14 views
Change element height on animation start (Angular)
I've set up a transition that slides between my views, like so: https://plnkr.co/edit/yhhdYuAl9Kpcqw5tDx55?p=preview
I need to set the view position to absolute in order to make the two 'panels' ...
1
vote
1answer
25 views
Module 'ng' has no exported member 'IDirective'
I am implemeting Angular 1 directive with TypeScript. Everything looks fine, it compiles, but I receive the following error in my Visual Studio Code editor:
Module 'ng' has no exported member '...
1
vote
1answer
21 views
Error during Karma Test execution
I have a problem current where my directives were build as following :
selectprice.directive.js file
(function() {
'use strict';
angular
.module('app.buyouts.selectPrice')
.directive('...
3
votes
0answers
33 views
Dynamically added attributes don't initialise
I am trying to dynamically add attributes to html elements that are generated and compiled in an ng-repeat statement.
I am using the following directive on input elements.
.directive('ngLoading', ...
0
votes
0answers
13 views
ui-typeahead - Working with object levels [Resolved]
I have a person object:
person = {};
person.city = {};
person.city.state = {};
First select the State
<input type="text" class="form-control" ng-model="person.city.state" uib-typeahead="state ...
0
votes
1answer
43 views
Change template in angular directive dynamically
I have a controller, that has some variables:
.controller('DataProvider', function($scope, $timeout, $mdSidenav, $mdDialog, $mdMedia, $mdToast, selectedData) {
$scope.provider;
$scope....
0
votes
1answer
35 views
AngularJS update value in a directive
I have a problem when trying to change the value of a variable from a directive.
I did a plunker so it is more understandable because I cannot explain it correctly.
I have two buttons list :
One is ...
0
votes
0answers
20 views
kendo autocomplete and keypress events
I implement an Angular directive based on the Kendo Autocomplete widget. My implementation includes handling the autocomplete events. On each onkeypress event my directive must perform asynchronous ...
0
votes
0answers
10 views
adding a movieClip with angularjs directive
I am trying to create a angularjs directive in order to add a movieClip to scope.stage But it has nothing in canvas(on browser) meanwhile I check scope.stage.numChildren is 1 and don't have error is ...
2
votes
1answer
85 views
Angular2 dynamic component
i work with angula2 + typescript. Right now in progress to add angular2-busy.
For this library i need include angular2-dynamic-component, but i don't know what i must do with him
This is error
This ...