Tagged Questions
0
votes
0answers
9 views
Array of ui-bootstrap typeaheads not in sync with underlying array
I am encountering a synchronization issue when trying to use a UI-Bootstrap typeahead inside an ng-repeat block. The issue comes up when my typeahead is being rendered by another directive.
...
-3
votes
0answers
28 views
Typeahead directive working with angular 1.2 and doesn't with angular 1.3
I have two examples of a autocomplete directive, if you hover
the mouse it should select the item as active it works fine with angular 1.2 but with 1.3 doesn't work, the problem is in the ...
1
vote
0answers
24 views
AngularJS: Using directives within dynamic HTML
I'm attempting to build dynamic HTML strings which include a directive that reacts to changes in a scope variable. If I build the strings statically then my $watch works properly, but if the strings ...
0
votes
1answer
8 views
Call jquery masonry using angularjs
i'm trying to get angularjs to work with jquery masonry. Without angular i have managed to get masonry to work fine including css. However, i have used angular to script the whole web app and i now ...
1
vote
1answer
18 views
AngularJS animate with callback, wait for the next animation to start
I have a simple AngularJS project with a directive that I want to start a CSS animation when another is done - hope i make sende, I have a jsfiddle example here, where the animation run at the same ...
0
votes
1answer
23 views
Coordinating Angular JS model changes via directives
I'm building a report viewer using AngularJS and am trying to figure out the correct method of handling changes to a report's definition via multiple directives.
For example, I have a report ...
0
votes
1answer
28 views
preventing ng-select from firing when focus is lost
I have a multi-select box created in Angular js with values from a database, some of which are preselected if they meet certain conditions.
fooSearch.html
<select multiple ng-model="foo">
...
0
votes
1answer
24 views
How to manually inject partial from controller in angularjs
I am new to Angular world and struggling on how to controll the loading of partials. In my app on a changing the value of drop down I am getting the template url (the url of the partial I want to ...
0
votes
0answers
19 views
call to controller function does not trigger $scope.$apply()
I am using a directive as a wrapper for custom form elements for a form builder tool. The directive is applied on each form element creating a basic template and an isolate scope (it is supposed to ...
0
votes
2answers
25 views
Angular directive, binding click event to outside element not working
I am trying to create a custom event for toggling with Angular. The directive is called toggleable.
It sounds trivial at first, but tricky bit is that i want to be able to to use any button or link ...
2
votes
6answers
44 views
What is the most Angular way to test for a click on the body in a directive?
I have a little dropdown directive that I apply to a nav element. I want to close the dropdown if the user clicks anywhere outside the nav element by setting $scope.menu.visible = false.
What is the ...
0
votes
2answers
61 views
why ng-click not working?
I write a directive to impl ng-disabled because i just can use angularjs which version is 1.1.5,it't not provide ng-disabled,so
tableApp.directive('myDisabled', function($compile) {
return {
...
1
vote
1answer
23 views
One directive with two names in Angular
Is there a easy way to assign two different names to a directive?
Something like this:
app.directive(['directiveNameOne', 'directiveNameTwo'], function() {...});
I have a directive which handles ...
1
vote
0answers
12 views
Firebase syncObject is showing redundant error in my Angular controller
I am building an app for a client who has, as one of their data sets a master list of all their members. I have the data coming in from Firebase and everything runs peachy, but it's not that DRY I am ...
0
votes
0answers
19 views
Data binding using AngularJS to Metro UI CSS 'data-transform' capability
I don't know if this is good form or not but I am rewriting the original post as I think it was a little confusing (I am not much of a writer). While this issue was encountered in an effort to port a ...
1
vote
1answer
18 views
Setting attribute value of an element in camelCase using a directive
I'm trying to add an attribute to an angularJs element from a directive like this:
element.attr('startOffset', val);
But when I check the element, the attribute added is 'startoffset' where the 'o' ...
0
votes
1answer
35 views
How to initialize the value of an input[range] using AngularJS when value is over 100
I try to initialize a slider using AngularJS, but the cursor show 100 when the value is over 100.
Setting the value 150 in a range [50,150] fails with this code :
<html ng-app="App">
...
0
votes
0answers
32 views
Angular JS - Sharing controller between directives
Can't seem to figure out why this is not working...
What I'm trying to do:
I need to be able to share the controller from the mainContent directive with the directive for focus and I keep getting ...
0
votes
0answers
22 views
ng change with custom directive
Javascript code for directive
angular.directive('uiDatePicker', [function() {
return {
restrict: 'EA',
scope: {
ngModel: '=ngModel',
...
3
votes
2answers
43 views
AngularJS: “Controller as” syntax and directives
I can't get one of my directives to work after refactoring my AngularJS code to use the "controller as" syntax.
Old working code (Fiddle):
<div ng-app='MyModule'>
<div ...
0
votes
1answer
30 views
AngularJS inner directive attributes
I have made a custom directive for a table in Angular JS which represents like this
`<div mytable api="data">
<div col="A"></div>
<div col="B"></div>
...
0
votes
1answer
28 views
Pass template url to angularjs directive
Is there any way to pass string object with template url to the directive?
My solution don't works correctly.
Javascript:
function moduleView() {
return{
restrict: 'A',
...
2
votes
1answer
27 views
how to clear or stop timeInterval in angular js?
I make a demo in which I am fetching data from server after regular interval of time using $interval Now I need stop/ cancel this .how I can achieve this .if again I need to start how I will start ...
0
votes
1answer
29 views
How directives are invoked If an element that contains a directive is added dynamically through an angular controller?
After doing some search I haven't found much information in this bad practice. Let's say I have a controller that behaves like that (I know it should have been a directive and that in controllers we ...
0
votes
1answer
26 views
Hiding a Link on user input on a form field
I am building an SPA using AngularJS and Bootstrap. I have a form which has a "Back" link on the navigation bar and 2 buttons (Save and Cancel). When the form is launched I want to display only the ...
3
votes
1answer
26 views
Angular ng-change delay
I have an input which filters a ng-repeat list on change. The repeat contains a lot of data and takes a few seconds to filter through everything. I would like their to be 0.5 second delay before I ...
0
votes
1answer
15 views
how to remove include module error in angular ?
I make a simple demo in my Pc which is working fine .But when I make fiddle to ask Question say
Uncaught Error: [$injector:nomod] Module 'myapp' is not available! You either misspelled the module name ...
2
votes
1answer
24 views
AngularJS passing an attribute value as a parameter in a function called by ng-change
I can't seem to wrap my mind around how I would pull this off. I have a directive which looks like the following:
.directive('seqWidget', ['Sequence', function(Sequence){
return {
...
0
votes
1answer
12 views
AngularJS HTML5 video ng-src empty from directive
My application loads several objects from a REST service. Each object contains a property that represents the Uri of a video file. My application takes this as the source to display several videos to ...
2
votes
1answer
31 views
How to solve lack of promise unwrapping when writing nested directives
I've got a few nested directives:
<first-directive>
<second-directive user="user">
<third-directive name="name">
<fourth-directive description="description">
The ...
1
vote
1answer
15 views
Validation using custom directive with angularjs
I have a form with input fields and have a custom directive for each input field to validate the data entered by user.Requirement is that when user leaves the input field with invalid data, error ...
0
votes
1answer
43 views
Why does Angular duplicate the tag even though I used .replaceWith
Can't explain this behavior - can you help?
I want to create a directive "iscope" that provides an isolated scope for the underlying DOM. Such that, for example, I could do the following:
<div ...
1
vote
0answers
38 views
+50
Angularjs validation behaves differently for 1.3.0 and 1.2.6
I wish to create a custom directive, which renders as an input type element. The directive should reuse the angularjs validation framework. Following is the custom-input directive in action which I ...
0
votes
2answers
28 views
can an angular directive provide a public method
I am new to Angular, and it's very possible that the answer to my question will be "that's not how it's done in angular".
I have a template-expanding directive that presents a checklist:
[ ] ...
0
votes
1answer
24 views
Angular js directive issue
Below is my code
I created a simple page and include a directive in it. And on ng-click in directive i want to call parent scope's method.
<html>
<head>
<meta ...
0
votes
0answers
22 views
Masonry not working for multiple widths
I'm new to masonry with angular. i have tried to get masonry working with angular up to a certain extend and im facing few issues with it right now. Below given link is what i have done so far and the ...
0
votes
1answer
30 views
Sibling directive/controller related lists (and master/detail) in Angular
I have approximately four main pairs of related directives, simultaneously displayed in my AngularJS UI. Generally speaking, each pair includes a parent list directive on top with an associated detail ...
0
votes
2answers
21 views
How to create a new model property that combines data from model record
In AngularJS 1.2, I have a controller that reads JSON data into single records. Those records (Conference Sessions) each have arrays in them that are the Session Speakers. That is, something like:
...
0
votes
1answer
30 views
Angular Directive Post Link Order Is Wrong (1.3)
I have a situation where I have two nested custom directives. Normally the post link functions are fired in reverse order, but in my particular case they are firing top down, which is prohibiting my ...
1
vote
2answers
50 views
Radio button returning the previous value when changing angular
I am trying to create a directive for a radio input with values. These values will be passed from a directive. I also want to update a value in the controller when the radio button is changed. Here is ...
0
votes
0answers
21 views
Angular multi-select and jQuery plugin
I would like to use Angular to make a multi-select with this dropdown:
http://tympanus.net/Development/ResponsiveMultiLevelMenu/index5.html
The structure works with jQuery but when I want to add ...
0
votes
2answers
45 views
What is wrong with my angular-module?
I have one simple angularJS module: angular-deck. It's module for work with a game deck. Not production, beta =)
So... And I have one problem which I can't decide. Game cards by default is a simple ...
0
votes
1answer
20 views
How do I share data between child directives in angular?
Lets say I have two directives parent-dir and child-dir
<div parent-dir>
<div child-dir>
<div child-dir>
</div>
<div parent-dir>
<div child-dir>
<div ...
0
votes
0answers
15 views
AngularJS: How to conditionally add/remove one way Bound custom attributes
In an individual module, I have a directive like this.
export class Directives{
static Init(app: any){
app.directive('getSearch', function(){
return {
...
0
votes
2answers
19 views
Angular Directive Two-Way Binding Issue
I am creating a custom input directive for some added features.
app.directive('myTextInput', [
function () {
var directive = {};
directive.restrict = 'A';
directive.scope ...
0
votes
0answers
20 views
Dynamically add and remove attributes in angular directive template
Hi I have a directive that builds a div tag used to embed a live preview of information on my webpage. In my directive I have a template that constructs this div tag.
However, I only want the ...
1
vote
2answers
18 views
Unable to return results from JSON flat file with HTTP get call in AngularJS
I am trying to remove a hardcoded array out of my code and into a flat file that I can replace at any time, so I am using HTTP get to do this.
With the code below it is not returning the structure in ...
0
votes
0answers
9 views
draw on canvas from bytes array with an angular directive
I'm trying to make a directive to display images on products from an array of bytes.
I got a service that turns a bytes array to a base64 string, then draw it on a newly created canvas. But I can't ...
-1
votes
1answer
30 views
Angular Directive isolated scope not updating
I have created this angular directive which works up to a point.
app.directive('albumArt', function(){
return {
restrict: 'AE',
scope: {
'pictures': '=pictures',
'source' : ...
1
vote
2answers
32 views
How to call scope methods defined in the link function from a directive's controller
Here's a Plunker - I want "To be replaced" to be replaced by "Replacement".
My problem is as follows. I have two directives, myTabs and myPane In myTabs' link function, I add a method to its isolate ...