Tagged Questions
0
votes
0answers
9 views
AngularJS directive scope property doesn't render in directive view
I have a problem with scope property of directive that doesn't render want to render in directive view.
app.js
.config(function ($routeProvider) {
$routeProvider
.when('/', {
...
0
votes
1answer
20 views
directive watch change of DOM attributes
I want to get x and y position of DOM element, so I put it in the directive:
<div class="resize-drag" movable-item ng-if="!isEmpty(workingMenu.header)" data-x-position="0" style="border: 1px ...
0
votes
0answers
14 views
Replace and recompile template [AngularJS]
We have an Angular 1.3.6 based system, that need to be customized - some templates need to be replaced. Now we are replacing the html files manually, and using $ocLazyLoad to retrieve additional ...
0
votes
0answers
19 views
Why does my Angular directive behave like this?
I want to implement a directive that changes some HTML colors in a view when a certain {{valueFromServer}} changes. Currently, I've tried the following:
View:
<span class="glyphicon glyphicon-...
0
votes
0answers
31 views
Angular Digest Loop on ng-style
I have a filter that changes filtered object. But when I'm using ng-style="item.gridSize"
My Filter: (The Algorithm for size Grid was taken (changed for my needs) from Here
angular.module("custom....
0
votes
0answers
15 views
Get File Name in input type file directives with Angular js
I use input type="file" to make form input.
I had no constraints in insert but I have a problem in edit or update data. To get data from files that are already input. Showing filenameif I click ...
0
votes
1answer
17 views
Error: Template must have exactly one root element when creating a custom directive
I have just began to use angularJS to develop projects so please bare with me here. I want to make a simple directive that has a button that will show if the cursor is placed over it. However, every ...
0
votes
2answers
30 views
Function in a controller not getting called
I'm using this template and I'm trying to get some data from the server in a directive's controller.
Here's the directive :
angular.module('BlurAdmin.pages.dashboard')
.directive('dashboardTodo', ...
0
votes
1answer
18 views
Dynamic template in AngularJS Tree List
I am trying to manipulate directive for tree list and I am wondering if I can manipulate HTML in DOM.
I want to add hyperlinks only if there is no children.
This is the code.
http://codepen.io/kimda/...
1
vote
2answers
29 views
$modelValue is undefined while trying to access it in a directive
I am trying to implement an inch to mm converter... All I want is, if user enters a value in inches in text box, the text box(view) should display value in inch. Where as the model should hold the ...
0
votes
1answer
25 views
Angular 1 Ctrl Function from Directive after app.run function
I have a directive for my menu.
In the $rootScope I set the Company and the User Permission.
Depending on the selected company and the permission i render the menu.
I set the company and the User ...
0
votes
0answers
17 views
AngularJS dynamic template with ng-include and separate template directives
I want to create a div which loads different templates dynamically, based on a context parameter:
My "search-results-container" directive:
app.directive("searchResultsContainer", function() {
...
0
votes
0answers
17 views
Angular Multiple directive asking for transclution
I am having the following error and it is driving me mad because it happens in a random way :
Error: [$compile:multidir] Multiple directives [dsRegion, dsRegion] asking for transclusion on:
http://...
0
votes
1answer
19 views
How to call parent controller's function from other directive?
<div class="post-cards event-posts" data-list="posts" data-opts="postConfig" data-active-tab="{{active_filter.id}}"></div>
postCards is a directive for the above markup. Inside this ...
0
votes
2answers
37 views
Display object if the sub array has length of more than zero
<select id="type" required name="type" ng-options="type.Name for type in types| filter:{Active:true} | filter:subTypeFilter(type)"><option value="" disabled selected>Choose your option</...
0
votes
2answers
27 views
Communicate between two directives Angularjs?
I am trying to communicate between two directives. I tried the service way, it didn't work. Maybe I am doing something wrong.
<list-data testing="trial" template-url="grid.html" link-passed="data....
0
votes
0answers
17 views
AngularJS How to pass the searchtext to filter a table in a directive
Using AngularJS. I have a couple of search fields for a table. The table is used in various locations with different data so I made it a directive. The search fields are outside of the directive. I ...
0
votes
0answers
22 views
While Creating $mdToast Service, function not calling
Creating the custom service, in that using $mdToast.show() method to display the toast message. This service is injected in another controller and calling this service function from that controller. ...
1
vote
0answers
32 views
Removing directive from DOM based on child directives
I'm writing a permissions lib to add to my angular website.
Each element will have permission attribute:
<md-button permission="adjust" ng-click="vm.adjust()">Adjust</md-button>
And a ...
0
votes
1answer
23 views
Undefined value in ng-model. Error: Expression 'undefined' in attribute … non-assignable
I have a page called index.html and I embedded a component called add-circle-form in the page. What I want to do:
I want to save the user choices in add-circle-form.js and pass the data to index.js,...
0
votes
0answers
11 views
Angular 1.x model formatter flickering back to initial unformatted value when page loads
I've got some base64 data I am displaying in a span:
<span contenteditable="true" ng-model="modelVal" html-model></span>
and i'm using a model formatter to decode it:
myApp....
2
votes
2answers
34 views
How to assert if an element exists in angular?
I am writing a spec for a directive. As part of the testing, I need to assert if an element with a class exists inside my root directive component.
I have tried the following.
it('should have a ...
0
votes
2answers
36 views
Pass variables to a dynamic Controller inside a Directive AngularJS
I got a directive that loads a different template depending on the variable type that is passed to it. I pass to the isolated scope of the directive the variables patient and service too.
.directive('...
0
votes
3answers
77 views
how to add pattern validation in angular
I am having a model with a float propert
public float Amount { get; set; }
and a text box to display anf edit the value of amount.
only number accepted
my text box should allow characters and on ...
0
votes
2answers
23 views
AngularJS client-side validation in directive
I'm using a directive to encapsulate a partial form. There's an enclosing form which passes the model values into the directive. Here's the basic layout:
<form name="userForm" class="form-...
0
votes
1answer
34 views
Call AngularJS directive from controller on click
Quick question, so I'm using tg-dynamic-directive to loop through a json file and output following tree. (See image attached)
So the problem is, when the "tree" gets very long there are some serious ...
1
vote
0answers
75 views
element height watcher is not working properly inside the angular directive?
<div ng-app="app" ng-controller="myCtrl" style="border:1px solid;height:300px;width:100%">
<my-movie>
Movie Title :
</my-movie>
</div>
<...
0
votes
0answers
23 views
Routeprovider and stateprovider together in my Angular 1 app
I am trying to develop an app using Angular 1.4.(Refer below image). I need suggestions on below
What is the best way to develop home Page in this. Should I use <ui-view>(UI routing) to ...
0
votes
2answers
39 views
How do you use ng-repeat with a directive/template?
I'm trying to use ng-repeat to iterate over an array I've defined. This would write out a custom Element, which has a Directive/template to replace it's HTML.
When I don't use ng-repeat, the custom ...
0
votes
3answers
37 views
angularjs variable after http call has null value
i have define the variable ttest defined before $http call.
after that i assign data to this variable .
the value ttest[0] has value in $http function but outside there is no value available there
...
0
votes
0answers
28 views
Google Map not loading properly in AngularJs directive
I followed this simple sample from Google Maps Documentation and converted to a simple angular directive.
mc-maps.directive.js
...
return {
restrict: 'EA',
scope: {
center: '=center'...
0
votes
1answer
65 views
ng-click doesn't activate scroll-to directive on first click but second?
I'm having some trouble getting ng-click to hide one set of questions but show another.
The setup is fairly simple. I have two answers to one question with one answer using ng-show="group" and the ...
0
votes
2answers
59 views
How to compile Angularjs nested directive with javascript
I have a nested directive that has nested hierarchy.
angular.module("app", []);
angular.module("app").directive("hero", function () {
return {
restrict: "E",
template: "<div>Hero {{...
1
vote
0answers
35 views
Angularjs get information from ng-model to a cookie
I've got these codes.
HTML
<div id="agregarpedido_table" ng-init="zero = 0">
<div id="agregarpedido_table_item" ng-repeat="entrada in entradas">
<input type="text" ng-model="...
3
votes
2answers
34 views
AngularJS: ngChange not called from directive
Brief intro to my problem
I have a directive that dynamically shows a list of checkboxes. It has a parameter called options that should be an array like the following, in order to show the list of ...
0
votes
1answer
17 views
AngularJS directive using a service as its scope
I have a simple view problem that I may have made more difficult by trying to create my first directive in Angular. I have this service that returns an array of user roles for the current user. Many ...
0
votes
1answer
55 views
How to change angular-material directive and compile it
If I compile native html element it works fine.
But if I compile compile Angular Material element (md-button) in console shows "Error: [ngTransclude:orphan]".
I am totally tired and can't figure it ...
0
votes
1answer
23 views
angularjs: can't get the isolated scope property via this keyword in controller with v1.6.2
In my angularjs project, I came into a strange issue. I don't have live demo, but try to describe my issue and debugging as detail as possible below:
I have a custom directive as following:
<div ...
-1
votes
1answer
18 views
Compiling string htmlusing angular compile not working having ng-repeat in it
Sorry for bad question format before. Changing this now
I have a html string which uses the ngrepeat to render the required div..
var templateHTML = "<div ng-repeat='entity in createCtrl....
0
votes
0answers
8 views
Why only outer directive executes when priority and terminal are set?
I am using nested directives with the outer directive having terminal : true. Inner directive has more priority than the outer but only outer is getting executed.
I understand that terminal is used ...
1
vote
0answers
27 views
Angular. Restrict 'A' doesn't work
I am building single page application using Angular 1.6 - component based approach, but I need to use directive to access component's DOM. Here is my module:
import angular from 'angular';
import ...
0
votes
1answer
32 views
ng-change within ng-repeat causing an angular error
I have an angular component whose html partial is defined as follows:
<div ng-class="{'chiptag2': !$ctrl.tag.isNew, 'chiptag-placeholder': $ctrl.tag.isNew, 'highlighted-tag': $ctrl.tag....
0
votes
1answer
12 views
Angularjs how to loads required js files home page index.html
We have angularjs app with lot of js getting loaded during the initial page load. Which are not required as part of home page. How we can void these. Is requieedjs solve this. How and when other js ...
0
votes
1answer
53 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
0answers
17 views
Search input type email for specific domain ending (outlook.com,gmail.com) using Angularjs
I have written a small form validation using Angularjs. The purpose of this
validation is to ensure only the people registered with the specific domain
can proceed and register as a new user.
The ...
0
votes
0answers
18 views
How to drag and arrange images with Angular.js with Orderid persisted in database
I am having a trouble with rearranging the order of images. I am using angular js v1. Now there is an order_id column in images table in the database. So when I drag and change the position of images ...
0
votes
0answers
24 views
AngularJS - Is there a way to overwrite a directive and prevent to original directive from executing?
I have a directive that registers a listener using the $on() function.
I am trying to overwrite this directive so that the registration of the listener is based on a condition. The problem is ...
1
vote
1answer
33 views
Calling Functions from AngularJs Directive
I need to insert a header in my AngularJS application.
I used to have a header and header controller containing login/logout functions since the header contains the username and login/logout.
Now I ...
0
votes
1answer
30 views
Pass value from scope variable into fcsa-number min option
Using fcsa-number directive for validating numbers in input field.
I want to restrict one field to get only numbers greater than value in another field. Can anybody guide me what am I doing wrong? Is ...
2
votes
2answers
26 views
When I set angularjs directive templateUrl $rootScope event does not populate
I have two directive that one of them broadcast a message to get another one like this: (demo)
angular.module('app', []);
angular.module('app').directive('foo',
function($rootScope) {
...