Tagged Questions
0
votes
0answers
4 views
how to send parameter value in second view in angular?
can you please tell me how to display the value of parameter on second view ?Actually I make a form in which there is two field : name and class .when user press(after filling fields) add it generate ...
0
votes
0answers
30 views
how to store and retrieve data in anguar js?
can you please tell me how to store data permantly (example local storage)and retrieve data .I want to store data so that I get again .I am doing client side programing ? I google it it say there is ...
0
votes
2answers
24 views
How can I get a change to the Model (from within a Directive) to update in the View? $apply?
There are a lot of questions/answers here on stackoverflow and out on google about this topic ($apply), and I feel like I have read every one and followed them, but to no avail. All my searches on ...
0
votes
2answers
18 views
How to add a style tag to the head using angularjs directive
Hi I am allowing users to specify whether they want to print reports in a landscape or portrait format.
I was wondering if it's possible to add this (see below) into the head of the web document ...
1
vote
0answers
16 views
Using slick caroussel inside a template
Our customer requested that we implement the kenWheeler slick caroussel: http://kenwheeler.github.io/slick/
Since our project is built with AngularJs we found the following directive that works as a ...
0
votes
1answer
26 views
Text Area linked with drop down
I have a drop down linked to a text area, so that when a choice is selected from the drop down the textarea automatically populates from the same model. A working version can be seen here: JSFiddle
...
0
votes
2answers
23 views
Dynamically add ng-click in dropdown directive
I'm trying to dynamically add a ng-click to a bunch of li's that get dynamically created inside of a directive. The idea is to hide the select element and overlay it with a custom div with a ul and ...
0
votes
2answers
21 views
AngularJS - Directive in combination with Jquery inside directive
How to achieve that I 'activate' jQuery(element).scombobox() inside a directive which is not ready a <select>.
To see more details please see the http://plnkr.co/edit
And this is the html:
...
0
votes
1answer
31 views
How should data be passed into a directive when a scope is populated asyncronysly
I have a controller which populates some data asynchronously. That data is used by a directive.
Unfortunately, the directive does not display the data. If I remove the timeout (which is what ...
1
vote
1answer
36 views
Angular autofocus directive doesn't work
I have a simple directive to give focus on an specific input field of form.
It just fails: element is not focused.
I thought it worked fine on Chrome, but, repeating tests, I did realize it was the ...
0
votes
2answers
22 views
Data Binding to convert mm to ft and inches or vice versa using Angularjs and ng-model
I want to convert lenghts from mm to ft and inches or vice versa. User can input either mm or ft&in.The case is I always want to save data in mm to database but use angular to see it in both ...
0
votes
1answer
14 views
How do I customize directive template based on attribute in Angular?
I'm trying to make an cell into an input if it's set to editable by an column definition variable but I'm not very successful. This is my directive
app.directive('bsCell', function() {
return {
...
3
votes
3answers
68 views
AngularJS - Directives in a template
I'm trying to find the best approach for dynamically creating the sub-contents of an element created using a directive.
To give a simple example, say I have directive that say creates a basic div ...
0
votes
0answers
6 views
Display a template inside ionic popup
I am using angularjs and cordova to build an app in which I am trying to display an ng-template which is defined inside my one and only html file. The template looks like this:
<script ...
0
votes
0answers
13 views
Trouble binding a complex UI with angularJs data-binding
I have an angularJs directive which binds a collection to the UI shown below:
The binding is all fine currently, the only problem is with setting the highlighted styles. The tiels which are ...
0
votes
1answer
17 views
SVG directive: css class added but not applied
[SOLVED]
I created a simple SVG directive using angular 1.3-beta which features a "type: 'svg'" for directive. The code is straightforward (see Plunker ...
0
votes
0answers
10 views
Recursive nested directives with transclude injecting wrong parent controller
I'm working on an idea to define a settings modal but I'm pretty new to angular and can't get my head around the recursive nested directive to build a tree in my scopes to represent the html ...
0
votes
1answer
25 views
AngularJS Directives: Inserting Attribute values in template
I am fairly new to AngularJS, and I have the following problem.
I have an HTML Element:
<div class="hn-multi-select" array-of-strings="testArray">
</div>
and a Directive:
...
1
vote
0answers
16 views
Angular-nvd3-directives adjust height of the chart according to the width of the chart
I'm trying to create a line chart using angular-nvd3-directives. To make it look good I need to set the height attribute to "250", that looks good large and medium screens. But, on small screens it ...
0
votes
2answers
11 views
How do you call a parent directive controller from a child controller (not link method)
I would like to access my parent directive from within my child.
I know that if you use the require property, then the link method has the parent controller passed as a parameter, but how can i ...
0
votes
0answers
33 views
AngularJS directive with template having ng-repeat and ng-bind-html
I have created a directive with template having ng-repeat and ng-bind-html as below
app.directive('customField', function ($compile) {
var getTemplate = function (customType) {
return '<span ...
0
votes
0answers
20 views
angularjs ajax call wrapped by $scope.$apply function preventing ng-click from being executed
I have and custom validation directive which triggers on change to validate user input:
link: function(scope, elem, attrs) {
elem.on('change', function() {$scope.$apply(function(){
...
0
votes
2answers
24 views
AngularJS specifying multiple values for attribute of custom directive
I am creating a directive <chart> in AngularJS. I want to add a attributes x-series and y-series to it.
A requirement is that these attributes should take multiple parameters like ...
0
votes
1answer
14 views
Compile custom directive before ui-bootstrap directive
I'm trying to create my own directive for a datepicker so when the page is opened on a mobile device the input type change to type="date" and the native datepicker gets displayed instead of the ...
0
votes
1answer
29 views
Set an element's attribute text/value through an angular directive?
How do I set the text of an attr?
Trying to set the values of meta tags description through it's content attr.
<title update-title></title>
<meta name="description" ...
0
votes
0answers
18 views
AngularJS: Zeus Slider Doesn't activate after first visit to page
I have a ZeusSlider on a site I'm doing for a guy in AngularJS, it loads the first time I visit the homepage, but not if I go back to the home page. The script is firing, so I'm not sure why the ...
0
votes
1answer
12 views
Isolated scope member updated within link/controller but is undefined when passed to controller
I have the following code:
HTML:
<body ng-controller="MainCtrl">
<main-dir data="data" on-update-map="updateMap(datalength)"></main-dir>
</body>
JS:
...
0
votes
3answers
11 views
What is the correct way to extend an AngularStrap directive?
I'm looking to extend an AngularStrap directive (typeahead in this case) to have more than the provided functionality. After some research, I'm thinking the best way is to wrap the typeahead directive ...
0
votes
1answer
21 views
Detect if a function is bounded to the scope with &
I have a directive popup that has an isolated scope with only a function binding in it:
Template
<popup>
<div class="confirm-button" ng-show="showConfirmButton" ...
0
votes
0answers
10 views
What are the exceptions to depth-first directive linking?
So for the most part, I find that AngularJS has a depth first approach to directive linking. For example, if we had the following markup:
<custom-outer>
<custom-inner>
...
0
votes
1answer
9 views
Problems with ng-repeat and ajax-loaded content in directive
I'm creating some directive that wraps up jCarousel plugin. But content for it loading dynamically via ajax.
So here are examples of my code:
Calling directive in HTML:
<div class="jcarousel" ...
0
votes
1answer
21 views
Disable text selection with Angular directive
I am learning JavaScript and AngularJS.
I want to disable text selection with Angular Directive.
I have a JavaScript code for that function:
function clearSelection() {
if(document.selection ...
0
votes
2answers
29 views
how to make ng-model value set by ui-select value
I am currently using angular-ui/ui-select in my project. I am able to bind the value of the ui-select to an object without issue, however it is binding the entire item that is being iterated over. I ...
-1
votes
1answer
21 views
Angular directive: watching an expression consisting of variable and function
everyone! Thanks in advance!
I have the following problem: I want to watch an input field's attribute, which at the same time is my directive's name, to focus and select the value when
a) the area ...
0
votes
2answers
19 views
Adding or duplicating directive dynamically does not get variable values from parent scope
I'm trying to figure out how I can dynamically duplicate my directive and at the same time maintain the variables from my parent scope.
here's a fiddle to make it clearer
...
-1
votes
2answers
19 views
Angularjs directive: Passing a model reference to an isolated scope
I 'm trying to write a collapsible, reusable calculator directive, that binds to an input field (in the parent scope). This input field itself has a ngModel binding.
When the user presses the ...
0
votes
0answers
23 views
Ng-Grid: Cannot read property 'on' of null
I am working on developing an angular.js directive which is simply a JQuery dialog box with a grid within it.
Directive Template:
<div class="datasetsGrid" ng-grid="gridOptions"></div>
...
-1
votes
1answer
27 views
what is the best way to attach events to children elements when using directives in angular
i am little bit confused about directives.I want to make a combobox and it consists of multiple elements.
angular guys say do not make any manipulation in the controller so they point link function.
...
-1
votes
0answers
12 views
Change module config data from controller - AngularJS
I have implemented Session timeout using AngularJS
Below is code:
var user = angular.module('user', ['ui.bootstrap', 'xeditable', 'ngIdle']);
user.config(function($httpProvider, ...
0
votes
1answer
27 views
How can I output a script tag that is stored as a string in my scope to an AngularJS template?
I need to use an embedded script in my templates but dynamically insert a path to an image before the script runs.
I've written a directive to build the image path as a scope variable, then use ...
1
vote
0answers
27 views
How to add field in ng-form, if this field is located out of ng-form (AngularJS)
I have:
<ng-form name="myForm">
<input...>
<input...>
<input...>
</ng-form>
<special-field ng-model="myField" />
and I need to add 'special-field' in ...
0
votes
1answer
21 views
Asterisks in input field indicating length with angularjs
I'm using angularjs for a app I'm working on.
I need an input field with a specific length of characters a user has to enter.
To indicate how long the input should be, I would like to have an input ...
0
votes
0answers
21 views
Angularjs Directive initialized in different order in IE11 and FireFox31
I have a directive where I define a link function in which I added few login listeners(custom).
And the respective broadcast will happen from a factory based on a condition. which is the function in ...
0
votes
2answers
40 views
Javascript inside script tag in an Angularjs template is not executed
I have a simple directive that displays three images. On mouse hover, it should switch from black and white to normal image.
Below given is the code inside the directive.
<div ...
0
votes
2answers
26 views
Angular - Populating JSON data in Select
I am populating JSON data in Select/options. The problem is once user selects an item, value attribute displays the selected JSON data (including itemID and itemName) rather than just displaying ...
0
votes
0answers
16 views
TemplateUrl not working in Angular
I'm experimenting with Angular, and I just don't understand why my directive won't work on my computer. When I use 'template' in my directive, I get the result I want, but when I do the 'templateUrl' ...
0
votes
1answer
12 views
Add Properties after json load
I have this json:
{
"info": [
{
"id": 999,
"products": [
{
"id": 1,
},
{
"id": 2,
}
]
}
]
}
Info
-- products
-----id
And my factory:
AppAngular.factory('model', ...
0
votes
1answer
31 views
How to simulate time passing in angularjs test?
I am trying to pass a simulate time passing in an angularjs jasmine test.
My directive that I am testing simply displays the current time and updates every second:
return {
restrict: 'A',
scope: ...
0
votes
1answer
14 views
How do I trigger a click event in a unit test for an Angular directive
I have an Angular app (running from an ASP.NET MVC project.)
In this app, I have a directive with the following link function:
link: function (scope, element, attrs, formCtrl) {
...
-1
votes
1answer
22 views
Shift click to add value to object without using angular directive
In HTML file:
...
<ul>
<li><a href="#" ng-click="addFruit('Apple')">Apple</a></li>
<li><a href="#" ...