Tagged Questions
0
votes
1answer
16 views
ng-pattern regex throwing error
I am using ng-pattern to validate number(Comma seperated input field allowing only number). But it is throwing the following error in the console eventhough it is working fine. Can anyone tell me what ...
0
votes
1answer
22 views
Angular 1.5 custom validation directive for ng-messages
I'm working on custom directive for ng-messages where with adding one directive "custom-validation" to input field:
<input name="inputName" ng-model="vm.inputName" custom-validation="vm....
0
votes
0answers
29 views
Angular v1 Component to Component data transfer
I'm struggling with a problem within Angular v1.6.1 where I am trying to transfer some data from a component to another component.
I have a component called navbar which resides in app\common\navbar ...
0
votes
0answers
25 views
How to handle jQuery(window).scroll functions efficiently in jQuery?
This is my current code and feels like it's not very efficient and would perhaps be better if Timer/Timeout is used. However, I'm lost as to how to go about it.
Could someone help? Not very efficient ...
0
votes
0answers
8 views
Setting Default Image angular-ng-upload directive Angularjs
I am using danialfarid angular-ng-upload directive.
Through my PHP Backend i get user information and i am trying to edit the information for that user. One of the fields are user_image which returns ...
1
vote
1answer
31 views
angular 1.6.1 '&' binding issues
Problem:
When I bind '&' under ng-repeat(or without for that matter atm), I can't seem to trigger the parent scope's function.
HTML
<div ng-repeat="type in fC.types">
<repeater type="...
1
vote
1answer
29 views
How do I prevent html element from being pushed down when dragging an element over?
I'm writing an angular directive using HTML Drag & Drop API. The directive works fine however it adds up an empty space between the elements when dragging an element over the other.
For instance:...
0
votes
1answer
14 views
AngularJS Directive names
I'm currently following this tutorial: https://medium.com/@tweededbadger/tutorial-dynamic-data-driven-svg-map-with-angularjs-b112fdec421d#.tk8zc63b6
He created a directive for 'svgMap'
angular....
0
votes
0answers
14 views
How to use amazingSlider plugin in AngularJS
I'm new to AngularJS and gone through lot of post to use jQuery plugin in AngularJS. But still I dont know how to use this amazingSlider. Please help me into it. I've created directive for slider, and ...
1
vote
1answer
20 views
Adding Form Fields Dynamically in angularjs not working
I am developing an online course application. I am trying to add form fields dynamically in my application, so that I can add more video lecture for a course. However, when I click on "Add Another URL"...
2
votes
1answer
33 views
can't pass dynamic parameter to angular directive
I just took over the frontend work of our angularjs apps and I'm stuck.
I've been creating directives to replace bloated html to make updating the frontend look easier. All was going well till I hit ...
0
votes
0answers
40 views
Angular $http.POST sending empty body sometimes
I am using $http to post some data, and receiving it on GAE backend with python. Most of the time everything is working fine, but some times the post body is empty. This keeps happening for specific ...
2
votes
1answer
18 views
Why does $compileProvider have a directive method?
I observe from the Angular documentation, that $compileProvider has both a directive() and component() method. See:
https://docs.angularjs.org/api/ng/provider/$compileProvider
I also observe the ...
0
votes
1answer
19 views
Passing Controller's $scope variable to nested directive's controller
I'm having trouble passing a scope object from one controller to a nested directive's controller.
I have a directive (child) within another directive (parent), the parent directive and its controller ...
0
votes
0answers
14 views
How to create angularjs directive with browserify?
I'm getting tripped up on the syntax, and my overall understanding. I've tried to create a directive as an element, and I get a repeating loop where it tries to load angular more than once.
Does ...
0
votes
1answer
23 views
ngModel.$setValidity only works once
I'm currently working on a angular bootstrap ui datepicker popup validation, the thing is that I can set the max a min date and validate that (only when the user set the date by clicking on the ...
0
votes
0answers
9 views
Not able to get data-bound data during the directive initialization when its wrapped in a ng-repeat
I've been creating a modularized start page (In Angular).
I've created a module-directive that can handle simple data and displaying them as a list.
Originally, my plan was to create new directives ...
0
votes
2answers
33 views
how to create custom directive to show ngFileUpload validation messages?
I wrote simple directive to show ngFileUpload validation messages as you seen below:
angular.module('app').directive('imageMessages', imageMessages);
function imageMessages() {
var directive = {
...
0
votes
0answers
26 views
How to reload directive from controller or is there need here directive
I have three links and three controllers for each three link.
But, same HTML page need to show. Just need to process (in controller) and reload that page on each click of that link.
If I create ...
0
votes
2answers
26 views
How to preserve scope in componentized Angular app containing a dialog that serves a custom directive
I have a question about how to pass scope to a template rendered from a directive. This seems like it should be so straight forward but somehow I am having a lot of trouble getting it to work.
My ...
0
votes
0answers
27 views
image preview directives using angularjs
I would like to have image preview upload with trigger another element,
so that I have put together in directives.
http://stackoverflow.com/a/25674293
AngularJS Image Preview before Upload showing ...
0
votes
0answers
12 views
what are some best practices for inter-component communication?
I am working on angularjs 1.5, Please refer following image to understand the question.
I have main component which contains Component A and Component C. Component A contains many Component B. I have ...
1
vote
1answer
29 views
Angular Nested Filters & Infinite $digest Loop
I (like so many others) have run into an issue with the infinite $digest loop. After reading many SO Q&As and spending plenty of time in AngularJS documentation I am still not certain how to build ...
0
votes
1answer
15 views
karma angular templateUrl not found
I've some problems when testing angular directives with karma, the problem is that when comes from templateUrl never translate it.
here is my karma.conf.js
'use strict';
var wiredep = require('...
0
votes
0answers
16 views
Override core angular directive
I know I can override a directive in the following way:
angular.module('3th-party-module')
.directive('3th-party-directive', my3rdPartyDirective)
However I would like to override the behavior ...
0
votes
0answers
7 views
Angucomplete-alt: set minlength programmatically in JS
I have a filter directive that uses angucomplete to filter items on a given page. Depending on the page I am on, I would like the minlength for angucomplete to do the initial filter to change. Is it ...
0
votes
2answers
35 views
AngularJS apply class on change in ng-repeat with pagination
I'm trying to apply a class to an item in a paginated list ,for that I just simulate a click on the element in the directive link property :
link : function (scope, element, attrs) {
...
0
votes
1answer
13 views
Angularjs - dynamic elements/templates
I'm trying to figure out the best way to create dynamic elements.
Basically, i have a multi-select list, eg...
Item 1
Item 2
Item 3
Once selected either one or more, it needs to generate elements ...
0
votes
0answers
16 views
AngularJS using string to select directive
I would like to select a directive via a string.
The controller would look like this:
app.controller('demo_ctrl',function($scope){
$scope.directiveName = 'theName';
});
And in the HTML it should ...
0
votes
2answers
32 views
communicating between directives controller
I know if I have two directives that are nesting I can communicate throw controller, require and pass it as the fourth parameter of the link function.
<my-first-div>
<my-seconded-div>&...
0
votes
0answers
34 views
ng-data-show not working properly with ui-select
If I use data-ng-show inside ui-select the input box takes width of 10px which is the inline style for that input box but if I remove the data-ng-show it works fine.
Why is it so? Is there any other ...
0
votes
1answer
14 views
Using template from 1 directive into another directives template
Basically I have 2 custom directives, each having it's own template. What I need is to insert one of the templates into the other. I have also read about transclusion, but can't wrap my head around it....
0
votes
1answer
35 views
Problems with isolated scope and bindings
I try to build directive in which i want to change model on clicking by element. Some sort of checkbox...
Here is my code
mainApp.directive('subCategory', function(){
return{
restrict: 'A'...
0
votes
0answers
68 views
$compile directive not hiding elements in ng-repeat
After upgrading from Angular 1.3.2 to 1.5.11 it appears my custom restrict directive is no longer working as expected. The directive is responsible for hiding elements through comparing a user's roles ...
-2
votes
0answers
33 views
Replacing a line in jQuery with AngularJS code for a click function
angular.module('homeApp', []).controller('myCtrl', ['$scope', function($scope,$http) {
$scope.multiSearch = function() {
$('#bs').attr('action','--actionvalue--');
$scope.indexForm.submitted=...
0
votes
0answers
25 views
How to send application level all click events to backend service - Angular Js
I am trying to capture all the events in the application like button clicks and want to send all the events to backend service with other parameters like name,location.
I created one factory method ...
0
votes
0answers
28 views
Pass an argument to a property function of a custom directive
I have a piece of code (plnkr), which stringifies a list of handsontables. Changing any cell value in a table will systematically change its corresponding string.
One thing I realise is that, after ...
1
vote
2answers
28 views
How to replace text on field after click Angular?
I have HTML code with inline element:
<span class="title" ng-click="update()">Rock</span>
How to replace this element on input element after click for edit?
And then after push enter on ...
0
votes
3answers
28 views
Angular directive not picking up the values set by parent
I have a directive that has a div, whose visibility is set by its parent. Expecting "show" to be true, but the div is still not visible initially on page load.
Directive:
<div ng-show="{{ show }}"...
0
votes
1answer
24 views
Angular - ng-click function on transcluded directive content is not triggered
I have two directives, parent directive should simply wrap around its child. The transclusion is used for this purpose.
However, then any other directive, such as ng-click, bound to the child ...
0
votes
0answers
28 views
Input type file not functioning when used as a directive in a dynamically created directive
I am rendering a directive (x) dynamically using the $compile service. This directive consists of another directive (y) which is a form to upload image consisting of the input type file.
This input ...
0
votes
1answer
20 views
Getting Uncaught Error: [$injector:modulerr]
I'm new to angular, and in the middle of refactoring my app to match John Papa's style of angular 1. However, this seem to break my views. I get Uncaught Error: [$injector:modulerr]. I'm referencing ...
1
vote
1answer
25 views
How to use Angular directive inside Kendo Grid Column
This is relatively simple, or so I would have thought.
I have a custom Angular directive - I can add it to the DOM with
<custom-directive ng-model="someAngularScopeObject"></custom-...
0
votes
1answer
33 views
Show form in each block was created by ng-repeat?
I have the following HTML code:
<div class="row">
<div class="col-md" ng-repeat="song in songs">
<div class="title"><div class="add">+</div></div>
...
0
votes
0answers
12 views
Angular Material to replicate Google contacts on hover change icon to checkmark
In an attempt to replicate what is done recently in google contacts I tried the following:
http://codepen.io/anon/pen/wgpyQY?editors=1010
<div ng-controller="AppCtrl" ng-cloak="" ng-app="MyApp"&...
0
votes
1answer
19 views
Using element.bind in validation directive
I trying to validate input with custom directive:
.directive('customValidation', function () {
return {
require: 'ngModel',
link: function (scope, element, attr, ...
-1
votes
1answer
34 views
How to trigger the function after DOM markup is loaded in angular style application except onload
I need to show a Simple current time with an angular based-application.So have tried a demo.
In the body onload function execute the piece of function.
<body onload="startTime()">
function ...
0
votes
2answers
35 views
AngularJs directive function doesn't work when declaring scope
I have a directive in which I'm passing an array of data via scope. However, when I click on a button with ng-click, the function doesn't work. This is my directive:
angular.module('appModule')....
0
votes
1answer
26 views
ENTER keydown doesn't work in IE! Angular
I have an input field where users insert a video url, and when press 'enter', video player display that video. It works fine in Chrome, Firefox, Edge but doesn't work in IE 11. It starts working only ...
0
votes
4answers
37 views
ng-change does not work, directive cant be found
<select id = "email_templates" name = "email_templates" class="chosen-select input-md form-control" ng-change = "alert('template selected');">
<option value="0">No template selected</...