Newest 'angularjs-directive' Questions - Stack Overflow

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.

0
votes
0answers
7 views

Adding directive to angular.module causes server to stop responding

I'm very new to AngularJS. I've started setting up a new project. Once I started adding a .directive to the angular.module, the server stops responding and seems to be caught in a loop (no option to ...
1
vote
1answer
25 views

@scope value attached to button control not updating? MVC AngularJs

I have a default value for $scope.buttonId = 0 which I am using in button ng-click function like, <button type="button" class="btn green" ng-click="vm.Update({{buttonId}})"> {{ 'Save' | ...
0
votes
0answers
30 views

How to assign values from the controller to directive?

On click of cancel, I am destroying the syncfusion treeview element and on click of add I want to recreate it. But when I am recreating the treeview I get a console error TypeError: Cannot use 'in' ...
0
votes
1answer
35 views

Parse Json data in Angular 6 Template

I am getting JSON response as below, { "Meta Data" : { "ticker" : "NEE", "datapoints" : 320, "credit cost" : 320, "Time Zone" : "America/New_York", "last refreshed" : "06/17/...
0
votes
0answers
27 views

date is getting changed in request json while hitting server

I am facing a strange problem with angular js 1.x, I have many calendars in a form to select dates. rfs date is only working fine rest dates are getting changes in request payload json while hitting ...
-1
votes
0answers
17 views

How to fix or create angularjs custom directive daterangepicker? [duplicate]

I'm creating a custom directive in angularjs but i dont know how to pass an ng-model to my controller. I already try to include ngModel and ngModelCtrl but it seems not working in my case. This is ...
0
votes
1answer
37 views

How to get values of elements of a dynamically added directive

I would like to know how can I read the values of elements of a dynamically added directive. Plunker here: http://next.plnkr.co/edit/he81ccvklc8luZB9 var dynamicDirective = angular.module('testapp', ...
0
votes
0answers
34 views

AngularJs call a scoped directive in iteself with ng-repeat doesn't take the new scope of the child

The problem is that i have called Directive1 in same Directive1 using ng-repeat , and the directive11 has a value in scope , but when calling the nested same directive with the new value, it seems ...
0
votes
1answer
26 views

AngularJS - Textbox class names are appended with -add when populate with handheld devices

I am using angular 1.5. I see the class names of textbox is getting changed to ng-not-empty-add, .ng-dirty-add, .ng-valid-parse-add and .ng-valid-add when the text box is populated with handheld ...
0
votes
1answer
25 views

How can I get my nested ng-repeat form inputs to stop updating each other?

My input fields are updating each other! There's clearly some pass-by-reference shenanigans here, but I can't figure it out. I have a custom directive that I'm setting up with ng-repeat: <my-dir ...
-3
votes
0answers
19 views

When I console this in an on change function of a textfield, there is an attribute named $id [closed]

When I console 'this' (console.log(this)) in an on change function of a textfield, there is an attribute named $id - what does it mean? Is the value of that $id unique?
0
votes
0answers
48 views

How to inject module on click of button?

I have one directive like following var directiveApp = angular.module("directiveApp", ['ngSanitize', 'ui.mask', 'ngCropper', 'ui.bootstrap', 'common.fabric', 'common.fabric.utilities', 'common....
0
votes
0answers
10 views

angularjs nested custom directives as “configuration xml”

I'm trying to build a series of custom directives to accomplish the functionality of the commonly used configuration files. The thinking here is like this: 1.Structurally, nested custom directives ...
0
votes
1answer
85 views

How access the JSON Object received at angular side?

I want to access the Photo attribute from the JSON Object, I am new to Angular and Loopback, I have been trying for Hours but I am not able to access that photo attribute. Here is the JSON object I ...
1
vote
0answers
50 views

Error: StaticInjectorError(AppModule)[NgForOf -> TemplateRef]

i need to create a Directive for validate show button for user or not . i create a directive in SahreMudole : @Directive({ selector: '[appValidatePermission]' }) export class ...
0
votes
0answers
28 views

Angularjs ng-flatpickr directive scope & binding not working

I can not pass scope variable to this angularjs directive. The directive (https://github.com/archsaber/angular-flatpickr) defines it scope as: var ngFlatpickr = angular.module('angular-flatpickr', []...
1
vote
0answers
37 views

why user not able to select image after remove?

Could you please tell me why I am not able to select “image” after delete of row. Steps to reproduce. 1 ) select any image from file chooser example “a.png” 2) delete/remove that item from list ...
0
votes
0answers
17 views

two way binding - updating the controller scope from isolated scope [duplicate]

Created a directive that contains datepicker. I am creating a validatio when the user is typing. How do I update the value of my datepicker from isolated scope to controller scope? plunker example ...
0
votes
1answer
30 views

Update a scope variable from a directive (angularJS)

I have a directive I would like to apply to multiple input elements to change their value. I've been successful in applying it to the input elements value, but for some reason that is not being ...
0
votes
0answers
10 views

jquery ui selectable with editable controls + copy/paste

I want to create a jquery selectable with editable input fields. The idea is to copy the value from one field, use selectable to select certain fields and then paste the value to the selected fields (...
-1
votes
2answers
34 views

AngularJS directive with isolate scope

I have a directive that might look like this: a.directive('autoResize', function($compile) { return { scope: {}, link: function(scope, elem) { // HTML here is just an example ...
1
vote
1answer
35 views

why is two-way binding undefined in angularjs directive link function?

I am trying to send data from controller to directive , but i am getting undefined why ? here is my code https://plnkr.co/edit/0gtFynDdvyY0sWqKGI2l?p=preview I do the following steps <div img-...
-1
votes
0answers
18 views

ng-dblclick not working in Internet Explorer

I am developing an app where I need to call a method on double click on a list item. I am using ng-dblclick directive for handling an event on double click. This is working fine in chrome and Mozilla, ...
0
votes
1answer
32 views

How to use ng-container and ng-template

I would like to provide another logo if a *ngIf returns true. For this I have created a ng-template and want to display it within an ng-container. Unfortunately, I can not get it right now. What am ...
0
votes
1answer
33 views

How to replace the \n to an empty spaces when it comes along with the string

I am trying to replace the \n or \r to an empty spaces which comes with some other additional word. But when I tried it never replace the value because it understand it as a new line. For example this ...
0
votes
1answer
19 views

Using $watch in angularjs directive, why it works only with function as parameter

I researching angularjs application, and i don't understand why $watch in directive working as expected only with function in first parameter. class PaginationController { constructor($scope) { ...
0
votes
2answers
72 views

Angular custom directive to use an if condition in ng-repeat

I am using panels to display the response which is dynamic in nature. I want to differentiate the panels using 2 different colors i.e., if the response has a status of positive, the panel or panel's ...
0
votes
0answers
34 views

Pass angular value in a HTML Helper method

I have a method @HTML.CreateOnclickAttribute() which is a server side method and it is creating onclick method after checking the {eventItem} value. This method creates a string like this ng-click="...
2
votes
1answer
46 views

Simentic UI date picker with Angular js ng model

Working on semantic UI date picker with angularjs. Trying to bind ng-model with semantic UI date picker but value of picker is not getting assigned. I have also looked on select of date text box value ...
0
votes
0answers
17 views

How to find latest array element from subdocument array using mongoose?

My schema definition is as follows: var nSchema = new Schema({ message: String, creationDate: { type : Date, default: Date.now } }); var sSchema = new Schema({ _id: {type:ObjectId, auto: ...
0
votes
0answers
11 views

Add edit/delete button in ngif condition

I need help to make the Delete button visible whenever I click on the list of names in a table. I need to do this using an if/else condition Basically, this is the code: There is just Add staff ...
1
vote
2answers
28 views

ISSUE: Kendo tooltip with custom angularjs directive and kendoConfirm

My current situation: kendo tooltip works fine alone. my new custom angularjs directive with kendoConfirm works fine alone. but once i try to use them both together on an element, then only the kendo ...
0
votes
1answer
23 views

How to Enable Or Disable One td value angularjs based On Radio Button Click?

Here In a table, multiple records are there, I want to enable or disable particular table data based on the radio button click. For Ex: If I click Yes then that row table data Should Enable. Rest All ...
1
vote
1answer
27 views

How to add value to array element withing collection using mongoose?

I have written the following mongoose function to create new document in mongodb createdata: (body) => { let sEntry = new SData(Object.assign({}, { dataId: body.DataId //, ...
0
votes
2answers
16 views

Mongoose: How to avoid inserting duplicate records?

I have written the following mongoose function to create new document in mongodb createdata: (body) => { let sEntry = new SData(Object.assign({}, { dataId: body.DataId })); ...
0
votes
1answer
50 views

Nesting (first) custom directive another (second) directive moves (first) custom directive to childscope instead of scope

The following is a template that works to the point that webix-ui directive points to childscope because it is inside of an ng-if... I need ng-if to wait for the $scope.init() to finish getting data ...
0
votes
0answers
32 views

Unable to save AnjularJS model using Object.assign()

I am trying to save model into mongo collection using the following statement ... createRecord: (body) => { console.log("Hello you are in createRecord : " ); let ...
0
votes
0answers
18 views

AngularJS templates/directives/scope - Nested directives see childscope, how to make them see scope? [duplicate]

In the the code below, get-risk directive operates at the scope level, whereas webix-ui operates at ChildScope level... How do I make webix-ui directive and all nested divs, including get-risk to see ...
-4
votes
1answer
45 views

Need to get Array Element

I have a need to get element in the array. States =[MiN_LENGTH = 2, MIN_PWD_LENGTH = 8] var result = this.States.map(t=> t.MIN_PWD_LENGTH);
1
vote
1answer
15 views

$parse:ueoe Error in angular js when parsing ng-pattern bound in directive

I have a directive that binds a string to apply as an ng-pattern in the directive itself, yet when rendered it gives a UEOE error. the directive is defined as: myApp.directive('myDirective', ...
-1
votes
2answers
36 views

Hide option when selected by another Select

I have two select's who uses the same list. When i choose the option "Foo" from select A the same option "Foo" must be hidden on select B. Any ideia how to do it with AngularJS ? I'm trying something ...
0
votes
1answer
98 views

How to Inject Services into Directive Link Functions

AngularJS Repeated Directive Instances - How to keep link functions DRY to avoid duplication on multiple instances of directive? Pretty much the title says it all but in summary I want to move the ...
1
vote
1answer
23 views

How to add callback to AngularJS Directive without using Isolate Scope Expression Binding

Defining scope to add a callback function on an anuglarjs sortable directive breaks sort functionality I found a simple directive that sits on top of jquery-ui for sorting a list visually. I wanted ...
0
votes
1answer
35 views

Angularjs Custom Directive not changing DOM

Use ng-if in Angularjs Directive I have a showTaskDetailView$ stream that I can subscribe to and I can push a boolean value through it. angular.module('Project').directive('something', () => { ...
0
votes
0answers
23 views

Collection is not getting created even after creating the model using mongoose

I have created a model using mongoose. However, it is not creating collection in mongodb. My connection is working fine though to the mongodb var mongoose = require("mongoose"), Schema = mongoose....
0
votes
0answers
15 views

How to render an angularjs directive inside of a slickgrid cell

We have a large number of angularJS 1.5 directives (around 100) that we use throughout our applications. We also use slickgrid almost everywhere to display mass amounts of data. A project has recently ...
0
votes
0answers
22 views

I cannot call/ trigger a uib-typeahead function from my custom directive

I cannot call/ trigger a uib-typeahead function from my custom directive I have tried this soln How to access $modelValue and $viewValue from inside custom directives? but could not succeed. Seems ...
0
votes
0answers
14 views

Need to use lisftilter with multiple fields

So I have this filter that I am using to filter patients by their first name. But what I actually want to do is reuse the same filter to filter users by their middle name, last name, and email. I don'...
0
votes
0answers
12 views

Jasmine Testing AngularJS Directive with Constantly Changing TemplateURL (ng-html2js-preprocessor)

I am trying to create jasmine unit tests for an Angular directive controller with the help of the ng-html2js preprocessor to load the templates. The problem I'm facing is, the templateUrl is set in a ...
0
votes
1answer
16 views

AngularJS | Redirect to MainRoute when use does not have permission to see the page

I am using a multi-tier auth-system, with my AngularJS App(Angular 1.6.4). Meaning, that a user has multiple permissions. Depending on the permission he has he can see or not the page the permissions ...