Tagged Questions
0
votes
2answers
14 views
Accessing the value from controller in directive when the value changes in the controller
I created this jsfiddle to illustrate my issue.
http://jsfiddle.net/RmDuw/84/
HTML :
<button ng-click="toggleAwesome()">My awsomw button</button>
<br />
...
1
vote
0answers
8 views
How to initialize an angularjs module by passing values/configurations
I'm new to Angular and I'm from jQuery background.
My question is How to initialize angularjs module by passing values/configurations. Here is the scenario.
We will have core module (which will ...
0
votes
0answers
18 views
update scope in directive after async call
I have a directive used to simulate a loading pane:
var loadingModule = angular.module('loading', []);
loadingModule.constant('MODULE_VERSION', '1.0.0');
...
0
votes
0answers
28 views
Ok to use element.addClass in angular?
Loving using angular but want to keep to the "best practices" and not get into bad habits.
Currently making a desktop application which is also available on mobile devices and found the bindonce ...
0
votes
1answer
16 views
Angular drop-down and text input in same field and Angular data-binding
Is it possible to create a field input in angularjs, which can take value from dropdown and also has custom input. So the following two input options should be one, and user can choose value from ...
1
vote
3answers
27 views
Angular does not update bound property
Fiddle
HTML:
<div ng-controller="MyCtrl">
<button my-event-directive>Click me</button>
<div>{{secret}}</div>
</div>
JS:
var myApp = ...
0
votes
0answers
16 views
How to trigger another model of directive
I use angular to write a dialog,when click button,append element.
html code:
<div class="box" ng-app="myApp" ng-controller="conCtrl">
<button ng-click="creatDir()">click ...
0
votes
0answers
14 views
When does an SVG element in a directive get updated?
Consider a directive of type "svg" that uses a template to render an SVG element within an SVG in the existing DOM:
angular.module('myapp').directive('component', ['$timeout', function($timeout){
...
1
vote
3answers
16 views
How to make a directive have a unique scope item for each use
I have created a directive and used it to make two time counters however I am a bit confused about how I can use different scope items for each time counter.
I have made a Plunkr to illustrate.
I am ...
0
votes
0answers
18 views
why contend show multiple time in angular while using ajax call?
I have two problem in my demo .I am making a pop over .I should open on icon click(here is used star icon).when i click star icon I am able to see pop up screen as I want but problem is that when I ...
0
votes
2answers
29 views
Change the dimensions of the root element of an AngularJS directive
I have an AngularJS directive which is used in Element mode i.e. it is used as a custom tag in HTML.
angular
.module('myModule')
.directive('myDirective', function() {
return {
...
0
votes
1answer
15 views
Angular.js: Store div content in scope variable
I have an editable div and I want to store the HTML content in scope variable scope.myText:
<div id="editor" contenteditable="true" ng-model="myText">
<p>HTML Text</p>
...
0
votes
2answers
14 views
Directive at angularjs and custom method/html
I have this code:
<body ng-controller="testController">
<div test-directive transform="transform()">
</div>
<script type="text/ng-template" ...
0
votes
3answers
29 views
why my ajax success data is not display in angular js
I am trying to call ajax and get my HTML contend .But I want to show that data on tooltip/or pop over .I am getting the data on console I don't know why it showing black data tooltip it is showing ...
0
votes
3answers
28 views
Watch element on directive
I have the next code:
angular.module("Test", [])
.directive("testDirective", function () {
return {
restrict: "A",
scope: {
model: "="
}
link: function(scope, element) {
...
0
votes
1answer
16 views
How do I set multiple unique charts in their own DIVs using an AngularJS directive and Highcharts
First, a HUGE thank you to anyone who can help me figure out how to get this working!
I am creating a dashboard which shows several main containers. Inside these containers are smaller ones with ...
0
votes
0answers
12 views
Passing a promise to Lazy load Select in Angular JS
I found the jsfiddle below and I want to make the options load from a promise passed into the select tag attribute that I already have in the scope... i'm a bit of a noob when it comes to passing data ...
0
votes
2answers
20 views
Tell child directive to act after a parent directive has done DOM actions?
Let's say we have some nested directives:
<big-poppa>
<baby-bird></baby-bird>
</big-poppa>
And let's say that big-poppa wants to create a component that all of his ...
0
votes
1answer
27 views
Update directive variable from controller
New to AngularJS I have a simple directive, service and controller. I loop through a list of items from a database in the controller embedded in the directive to render a checkbox list of items. From ...
0
votes
1answer
17 views
AngularJS - how to export content of a directive (ng-repeat) into separate downloadable HTML file
As in the title: How can I use Angular to allow downloading the content of a div (ng-repeat directive in this case) in a new HTML file?
I have tried this:
var content = 'file content';
var blob = ...
0
votes
1answer
16 views
why pop up or tool tip not display on icon click?
I am trying to show tooltip on icon (star button on each row).But I don't know why it display without any event.i want to display tooltip or popup when user click on star icon .I make a custom ...
0
votes
0answers
24 views
Angular js creating a generic directive
I am trying to create a generic directive in angular, for example, take this html:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>Testing ...
0
votes
0answers
22 views
nvd3, angularjs, using angularjs-snap for vertical slider with dropdowns, lists
I am creating charts using nvd3. The data for the charts depends on the customer id which I need to select from a dropdown. Similarly, in future I would like to have carrier list, city drop down, etc. ...
0
votes
0answers
32 views
Dynamic Templates using Angular JS
I'm following this Blog post < http://onehungrymind.com/angularjs-dynamic-templates/> to understand the loading of dynamic templates using Angular JS in the same view. Now my requirement is ...
0
votes
1answer
34 views
how to click particular item in directive using angularjs
Hi I am trying to click on a particular item using id in a template of a directive below is my directive
app.directive('dropdownmenu', function($window) {
return {
restrict: 'AE',
...
0
votes
1answer
20 views
AngularJS: ngInclude with custom scope
I have an existing directive that creates a generic wizard that will be used across my current organization. This wizard will have steps, and each step has an HTML template to be loaded as the "body" ...
0
votes
1answer
24 views
How to set focus on controls using angularjs?
Am using textboxes in various places of my project.I used autofocus on textbox control and it worked fine but in partially loading pages autofocus is not working properly.
So can anyone please tel me ...
2
votes
0answers
26 views
Should a factory return the definition object or the function in AngularJs? [on hold]
The official AngularJs developer guide for Directive (https://docs.angularjs.org/guide/directive), in the Creating Directives section, suggests that:
"Best Practice: Prefer using the definition ...
0
votes
2answers
23 views
Clear the ng-model asssociated to textarea inside Angular Bootstrap UI tabset form an outside button
I have used angular bootstrap ui tabset to create two tabs and both of the tabs have textareas associated with a ng-model, i have a clear button outside the tabset and i want to clear the ng-model of ...
1
vote
1answer
31 views
I need to put a space inside ng-true-value=“fa-li ” Angularjs
The plunker shows my list working the way I want. but I am unable to put a space between my list items.
It would be ideal if ng-true-value="fa-li " read that space but it doesnt.
I thought about ...
1
vote
1answer
33 views
why pop over display all time in angular?
I make a pop over using directive .But my popover display all time when i generate row dynamically .I need to show popover or tool only on icon click ?
Now it is display without click and also ...
0
votes
2answers
29 views
Creating partials with a directive
I'm compiling a feed for my company's different blogs. The format is going to be identical for each feed with only different posts being loaded in, so I'd love to go DRY and use a partial.
We ...
0
votes
2answers
22 views
Angular Print Checked boxes to an area
I have a list of checkboxes... when any of them are checked I want them to print in the area where I use the {{}}... If it is not checked then I want there to be no visual sign that there is anything ...
0
votes
1answer
28 views
Use HTML in Angular Directive parameter
I'm trying to pass html code to an angular directive as a parameter. Is this possible?
Here's the directive in the html. Inside the directive, the <br><br> comes out in plain text.
...
0
votes
0answers
37 views
Is there a way get width and height of child element in a directive in Angularjs
I am using an angularjs directive with a template to append divs to element. CSS automatically styles its width using max width. How do I find this width for further processing? I tried:
for(var ...
0
votes
1answer
28 views
avoid DOM manipulation using jQuery in ng-repeat
I am new to angular and working on a simple CRUD application. I understand that I must avoid DOM manipulation using jQuery if I can.
I am displaying data on the page after I get data from server ...
0
votes
1answer
22 views
how to create star icon in each row angular?
I am trying to make star icon in each row.I am generating the row dynamically but I am able to generate rows but my star icon is visible on upper of top row why ..I need to show start icon in each row ...
0
votes
0answers
15 views
Multiple AngularJS directives using the same $interval
I am creating a directive that manipulates a DOM element once per second (imagine this countdown example from the official docs). I generate a table containing a few hundred rows where one column ...
1
vote
1answer
28 views
AngularJS directive above table
I have table and template directive rnRow
<table>
<tr><td><span class="text-primary ">0 :</span></td><td><span class="text-default "> ...
1
vote
1answer
37 views
Should angular $watch be removed when scope destroyed?
Currently working on a project where we found huge memory leaks when not clearing broadcast subscriptions off destroyed scopes. The following code has fixed this:
var onFooEventBroadcast = ...
-1
votes
0answers
44 views
Passing function into angular directive
I try to pass a function into my angular directive.
The function should be declared inside the view and not part of the controller.
<div myDirective
myFunction="function(foo) { return foo.bar ...
2
votes
1answer
44 views
Controller not a function, got undefined, while defining controllers globally
I am writing a sample application using angularjs. i got an error mentioned below on chrome browser.
Error is
Error: [ng:areq] ...
0
votes
0answers
22 views
Angularjs: custom directive data is not displyed
controller
myApp.controller('TodoListController', ['$scope','restService',
function($scope,restService) {
restService.getAll().$promise.then(function(data){
console.log("fetch ...
0
votes
0answers
29 views
Confusion about angular $digest cycle
I'm creating a directive that will allow you to style a "dropdown" anyway you like. Basically what I'm doing is hiding the actual select element and providing a div with a ul that will have all the ...
0
votes
1answer
39 views
AngularJS directives: Substituting attribute values directly into template
I've been trying to develop an AngularJS directive that outputs a labelled form-field.
I'd like to be able to use a tag like the following:
<simpleTextField bind="user.email" label="Email" ...
0
votes
2answers
32 views
ng-repeat on two arrays
I want to do a ng-repeat on an array which is composed of two arrays, like this :
[titles: [], links: []]
My arrays (titles and links) have the same length
What i want to print in my ng-repeat, ...
-1
votes
1answer
45 views
Query not working for me
I am using angularJs ng-resource.I have tried this
angular.module('app.services', ['ngResource'])
.factory('AngularIssues', function($resource){
return $resource('../test.json',{},{
...
0
votes
0answers
22 views
What I do wrong? How to use $digest right way?
What I do wrong with $digest. How to write right way?
I know that $digest updates the results on the page. But in what way will recieve right?
(function() {
'use strict';
function ...
0
votes
0answers
24 views
AngularJS directive with transclude from a promise ($resource)
I am completely new to Angular and have been attempting to make a simple blog to get to know some of the features.
The design I have is a JSON API for posts, which include a post title, created and ...
2
votes
1answer
34 views
Uncaught Error: [$rootScope:infdig] in browser console when implementing a elapsed time calculator
Uncaught Error: [$rootScope:infdig]
I am getting this above error in browser console in a elapsed time calculator code, I calculate elapsed time from current time when app starts.
Here is my html:
...