0
votes
2answers
35 views

Scope function isn't receiving a callback argument

I have a controller like this: angular.module('main', []).controller('mainCtrl', function ($scope) { $scope.doStuff = function (cb) { // Do some stuff. cb(); }; }); And I ...
0
votes
2answers
10 views

angularjs - Watching service properties in a controller scope… changing them from a directive… no update?

Let's say I have a very simple service with a few properties on it. If I use the service in a controller, put the service's properties on the scope so that they are bound to my view, and update them ...
0
votes
0answers
15 views

How to add active class inside header navigation directive inside a controller?

Since my app has a navigation menu repeated in several pages, I made a directive for it. Now, the .active class isn't applied to current page anymore. Do I need to put the controller inside the ...
0
votes
0answers
12 views

Cant integrate facebook login to angular app using ngFacebook

Somehow I am not able to integrate facebook Login to my angularjs app, though I feel I am just loosing a minor mistake which I cant point out and thus you geeks might be sureshot help! I have used ...
0
votes
1answer
26 views

$watch in parent's directive doesn't catch child directive changes

I have two directives : directives.parentDirective = function(){ return{ restrict: 'A', scope: true, controller : function($scope){ $scope.childs = {}; ...
0
votes
0answers
31 views

Function inside of directive runs twice

I have a directive which is used in 5 different views. I have my directive inside the view, then in the directive I add a specific function for each scope where directive is represented. Afterwards, ...
1
vote
2answers
18 views

Angular directive - update parent scope when another directive as also isolated scope

I have written an angular directive that needs to update the parent scope. angular.module('app').directive('googlePlace', function () { return { restrict: 'A', require: ...
0
votes
1answer
20 views

BxSlider and Angular js

If you are working with Angular, probably you will have case where you want to call some JQUERY library to do something for you. The usual way would be to call JQUERY function on page ready: ...
1
vote
2answers
32 views

Grab $viewValue from controller

How do I access $ngmodel.$viewValue in the controller? I have a ui-mask and it's not producing the correct value for the ng-model so I want to extract the value I see from my input field.
0
votes
2answers
26 views

How to add TemplateURL for a variable inside Directive Link function?

How can I include a template URL inside link function in a directive? I am trying to do something like this: app.directive('something', function($compile,$timeout) { return: { link: ...
0
votes
1answer
20 views

Multiple Image Upload in Angular JS

My form will have two file input fields and other fields.The user will be sleecting two different types of files and putting in some data. On submit button I want to send both the files along with the ...
0
votes
3answers
32 views

In AngularJS, how can I remove an element created using $compile?

I've written a simple example, where I create an element dynamically using $compile. This new element has another button, with which I want to remove this element (I've read that it is good to destroy ...
0
votes
0answers
6 views

How can I use this directive repeatedly across my code by putting it within a controller?

If a directive has the following directive? This is the code '<div id="{{textareaId}}" style="resize:vertical;height:{{textareaHeight || \'80px\'}}; overflow:auto" contentEditable="true" ...
1
vote
0answers
27 views

Angular directive in ng-repeat doesn't call link

I'm fairly new to Angular and am having some trouble getting a directive to render within an ng-repeat. This is probably a lack of experience on my part so any help is greatly appreciated. Here are ...
0
votes
0answers
9 views

Add multiple rows between drag and drop of table rows between two similar table in jquery with draggable and droppable

i am trying to drag a table row and to drop it in the similar table i.e, of same table structure. i am trying to implement with j query drag-gable and angularjs i found many example with single item ...
-2
votes
1answer
28 views

Extend Directives Scope AngularJS

I have two directives, that use the same function, depending on manipulating the view and the data. scope.hide() scope.show() ... Currently I am writing a service, but services are mostly for data. ...
0
votes
1answer
17 views

AngularJS change multiple partials per request

I am new in node.js and Angular and I am creating a web application. At the moment I have the following design of my application - the screen is separeted by three columns - the left one is my menu ...
0
votes
0answers
25 views

Directive not binding to model in controller surrounding it Angular

Directive not binding to model in controller surrounding it. I have a directive WYSIWYG and it is not binding to the model of the the enclosing controller. The Plunkr my view <span ...
1
vote
1answer
36 views

Change value input AngularJS with a directive in AngularJS

I need to change the value of a input when the value doesn't satisfy a condition. In this example, when I add a Detail and change the unit price input if the value isn't a number should change the ...
0
votes
1answer
21 views

Directives enclosing scope Angular

Having trouble binding my directive to a model in the controller enclosing it. The value for ng-model is not being put in the directive. The value of the model remains the variable name "val" once ...
0
votes
2answers
28 views

How do I ensure a directive's link function runs before a controller?

In our application we have a view being loaded via a simple route. $routeProvider .when('/', { template: require('./views/main.tpl.html'), controller: 'mainCtrl' }) ...
0
votes
1answer
19 views

ng-repeat wont refresh WITH $apply

This is the code I'm using (and have been using throughout the whole project), the scope is updated but ng-repeat wont refresh and I'm using scope.$apply.. Have no idea why, few devs also took a look ...
0
votes
1answer
13 views

AngularJs inject controller from different domain

I've been using DurandalJs for an application I've developed where I have a core group of functionality (JS, Html files) saved in domain XXX. I have a client app (domain YYY) that uses the JS, Html ...
0
votes
0answers
17 views

Using attribute containing 'start' in a directive doesn't work

I was trying to pass variables to a directive but I kept on running into issues with one of them constantly returning an 'undefined' value, even after reordering. It seems at first as though Angular ...
0
votes
1answer
30 views

making a ajax call to populate scope data in angular js

Hello i have a angular js controller like this function InstantSearchController($scope){ $scope.items = [ { url: 'http://tutorialzine.com/2013/04/services-chooser-backbone-js/', ...
1
vote
0answers
23 views

AngularJS - multiple use of component with same controller, using different data

I have a simple component that is being included using ng-include. The controller of the component is assigned in the included HTML. I would like to use the same component twice (or more) but load ...
0
votes
1answer
67 views

How to load constants from service to directive?

I am trying to load language constants from service to a directive and show them to user. I have discovered that if I just use {{}} in div, then the text is not rendered. However, by adding any ...
0
votes
3answers
35 views

AngularJs: Calling contoller method from directive inside another directive

I have a directive inside another directive. Outer directive shares its scope with controller, while inner one has its own. I'd like to pass a reference to controller's function to inner directive so ...
0
votes
0answers
18 views

AngularJS $animate service not firing when the class changes

UPDATE: I ended up using css3 to animate based on class changes. This solved my problem. Don't think you should really do it the way I was trying anymore. ...
0
votes
1answer
29 views

Angularjs directive 2 way binding not working + delay issue

I'm having the following problem. I have a search.js controller which uses a template results.html. That template uses a category directive to show all categories that any of the company products ...
0
votes
1answer
9 views

un-hiding a data-bound thing ( ng-model or {{food.foo}} ) breaks the binding

My problem: I can modify my model fine, and the changes are reflected in my view, as long as my view is hidden. As soon as my view is un-hidden, changes made to scope.food.foo from timeouts, event ...
0
votes
1answer
16 views

Trouble accessing scope attribute in directive

I am trying to access the values in $scope.photoRes in my directive but as of right now the console.log(scope.photoRes) in the directive just shows an empty object. Output from the console: Object ...
0
votes
2answers
36 views

Angular transclude and scopes

I am trying to generate a directive for click-to-edit input fields. Since I have a variety of different types of input fields that it needs to work with, I wanted to make it an attribute type ...
1
vote
1answer
40 views

Unable to get $error.maxlength validation in Directive

I am creating a directive that adds a template with text type input to the view. In this directive, I am trying to add the span class for error notification if the text field input is more than max ...
2
votes
1answer
30 views

Using ng-repeat in directive with isolated scope

ng-repeat inside a directive with isolated scope is not picking up the property that's passed through '=' binding. HTML: <body ng-controller="myCtrl"> <div my-directive list="users"> ...
0
votes
1answer
21 views

AngularJs Controller scope in tooltip form

I am trying to implement a form in a tooltip , that is dynamically inserted. Th form on submits calls the function in person controller and input field is mapped with scope model. But the problem is ...
0
votes
1answer
39 views

Angular.js passing scope properties as reference to directive?

How can I pass a controller scope as reference to my directive? I want to pass some values like <mydirective id="data.User.id" name="data.User.name" /> to the directive and when its changed ...
2
votes
1answer
23 views

Injecting angular element from controller but not working as directive

My problem is that a html element needs to be replaced with a directive on event call. So i am calling a function in my controller on click event and appending the angular element at the desired ...
0
votes
1answer
39 views

Angular dynamic nested directive, passing a new scope to each child?

I'm trying to create a nested directive in angular, which is specified by a large, possibly deeply nested config object. I'm having trouble figuring out how to get the correct scope to the correct ...
0
votes
1answer
24 views

In AngularJS, after isolating scope and binding to a parentFunction, how to pass parameters to this parentFunction?

I'm trying very hard to understand scopes in AngularJS and am running into problems. I've created a simple "comments" application that has an input box for publishing a comment (text + 'Reply' ...
3
votes
1answer
65 views

Template with its own controller for angular js

I am kind of new to angular JS and this might be the simple question but i am stuck on this. What i am trying to do is, I have one page and on that page I want to add a template. My template is kind ...
0
votes
0answers
24 views

Auto Focus on click of button in angularjs and also scrolling of screen using angularjs

I have button on click of that button a div render with many input text field.I want cursor should goes to the first input text and screen should also scroll.Is it possible with ...
1
vote
3answers
53 views

AngularJS - How to access $scope from a directive with specified scope

I have a custom directive which has got it's own scope which accepts values from the directive's DOM attributes but there are a few vars from the $scope which I want to access from the directive too. ...
0
votes
0answers
15 views

Call event after interpolation of a tag complete

View: <div class="module"> <p id="clampjs">{{test.pageTitle}}</p> </div> I need to put ellipsis at the end of the pageTitle , if it cannot be wrap upto 2 lines. For ...
0
votes
1answer
30 views

AngularJS adding input value to $scope

<input id="width" name="width" style="width:100px" type="text" ng-model="width"> How would I get the value from above to write into the $scope under $scope.user.width when there is no default ...
0
votes
1answer
19 views

Angular VARIED, database-dependent callback after render

On my blog, I want to be able to have post-specific interactive demos. So each post has both its content and the example demo, which is HTML to be rendered to the page. So far, no problem. I created ...
1
vote
0answers
51 views

What is the best way to set default values to the isolated scope of a directive

I´ve seen here a lot of different descriptions of setting the default values for the isolated scope of a directive. But what is the best way to do this and where should I do this. Is it better in the ...
0
votes
2answers
52 views

Ng-repeat not showing JSON data in Angular-UI

I am trying to pull in data from a JSON file and use it to populate a navigation menu, composed of Divs that collapse using the Angular UI collapsible function. I've enclosed a plunk: Plunk of the ...
0
votes
1answer
32 views

where should I set up the $watch in angularjs

I have an angular directive that is supposed to display some data structure. the data structure itself is supposed to be selected using a select box. <div>There are {{blocks.length}} blocks in ...
0
votes
1answer
23 views

Scope and association with Directives in AngularJS

Please help me understand scopes in AngularJS. If I associate a controller within a directive (as opposed to within html), is it supposed to have any impact on the scope associated with the ...