0
votes
1answer
6 views

Angularjs + RubyonRails + Google Maps Error: [$injector:unpr] Unknown provider: tProvider <- t

Iam creating an App with angulajs and rubyon rails.i want to show the google maps to the user for a partiular latituts and longitude i am gettig this kind of error here is my code. Angularjs ...
0
votes
1answer
16 views

AngularJS: DOM manipulation once view is fully loaded

Apologies for the long post - I hope it doesn't put too many people off. What I have is working, but I'm just not sure if it's the "correct" way of doing things, so I'm just looking for some advice. ...
0
votes
1answer
24 views

Angularjs: is this the correct way to use controller and directive?

Normally the directive will use data in the scope, for example: <div my-directive data-x='x' data-y='y' data-z='z' ...> </div> However, the arguments of the ...
1
vote
1answer
14 views

Why angularjs uses foreach(object,func)/trim(str) etc in place of object.forEach/str.trim

I was going through code of angularjs, Inside ngList directive I have found that angularjs uses custom defined foreach(object,func)/trim(str) etc in place of javascript natively defined ...
0
votes
0answers
16 views

Angular ngAnimate module will break my open layers map directive

I've made a directive that display an Open Layers map. app.directive('tchOlMapCopy', function () { var MAP_DOM_ELEMENT_ID = 'tchMap'; return { restrict: 'E', replace: ...
0
votes
1answer
21 views

In an AngularJS expression is there a way to compare a scope value to a value in another library?

I'm creating a directive around a third party library, to go in a form, where the option chosen in a select drop-down will bring up a different set of form elements. In the parent element of each ...
0
votes
2answers
26 views

Iterating inside a ng-if or ng-show in AngularJS

I am working on a AngularJS web application and sometimes I need to check if the element inside the ng-if or ng-show directive is inside a list. I'm doing this now: <div ng-if="object.element=='A' ...
0
votes
0answers
18 views

Custom directive 'A' angular js not working in grails gsp

I have a directive that looks like this: angular.module('myApp') .directive('appTooltip', function () { return { restrict: 'A', scope: {}, link: function (scope, element, ...
0
votes
1answer
17 views

how to show and hide element inside a directive depending on its attributes with angular

I'm pretty new to angular. I created a directive which calls a featured itens templateUrl that will be reused in multiple parts of the page.. this partial sometimes display a "view all itens"button, ...
1
vote
1answer
14 views

Angular JS Karma Testing 'undefined' is not a function (evaluating 'ngModel.$setViewValue(undefined)')

I am trying to test a directive and I keep getting TypeError: 'undefined' is not a function (evaluating 'ngModel.$setViewValue(undefined)') What am I doing wrong? The directive is to clear hidden ...
0
votes
1answer
18 views

Angular dynamically created directive not executing

Plnkr sample: [http://plnkr.co/edit/jlMQ66eBlzaNSd9ZqJ4m?p=preview][1] This might not be the proper "Angular" way to accomplish this, but unfortunately I'm working with some 3rd party libraries that ...
1
vote
0answers
7 views

Cannot test directive scope with mocha

I have a simple directive with an isolated scope that I'm trying to test. The problem is that I cannot test the scope variables defined in the link function. A watered down sample of my directive and ...
0
votes
2answers
45 views

AngularJS directive scope property matching

I am trying to write an isolated directive that will run regex to validate certain input fields. I want the directive to know what regex to match up on and use based on an attribute on the input. a ...
1
vote
2answers
29 views

Where to put conditional logic in an Angular directive

I'm just getting stared with Angular's directives, and while I could probably do this in-line in a template, I've committed to the notion of creating a directive for the following task... I have a ...
0
votes
1answer
26 views

Angular ng-repeat groupBy and Keep order

Im using this filter https://github.com/a8m/angular-filter#groupby to order my data like so, and it works great: <div ng-repeat="(key, value) in tags.tags.objects | groupBy:'category.name' "> ...
0
votes
0answers
12 views

Angular Directive Custom Transclude Template

I am making a Tile Directive where want the user to provide the template/data model (for decoupling). <tile contents="data"> <p>Title: {{ title }}</p> <img ...
1
vote
2answers
19 views

How to structure angular factor/service that manipulates DOM

I'm building a growl like UI in angular. I'd like to expose it as a factory (or service) to make it available in my controllers. Calling growl.add will result in a change in the DOM, so it seems like ...
0
votes
3answers
21 views

AngularJS multiple directive elements with template and broadcasting from controller

I have a directive element with a template. The directive template contains a button with an ng-click to call a function in a controller. When the button is clicked, the controller broadcasts an ...
0
votes
2answers
17 views

Where to put a helper function in angular's directive?

I created a simple directive: angular.module("foo").directive('bar',function(){ return { ... template: '<div> \ <div ng-hide="param1.length == ...
0
votes
0answers
13 views

How to use angularjs directive into directive

I have a directive.This directive handles drag and drop of child element. The list of the child elements will be generated by the directive from an given array of data. To render each Element I'd like ...
0
votes
1answer
21 views

AngularJS: All set of available controller's params

In book AngularJS from O'Reilly there is a chapter about directives. In controllers section following information: controller: function controllerConstructor($scope, $element, $attrs, $transclude) ...
0
votes
1answer
17 views

Child Scope not changing parent scope

I have two directives and am trying to filter a table based on a select box. I am using ui.bootstrap to create an accordion to hold the form. For some reason my form will not change the parent scope ...
0
votes
0answers
24 views

AngularJS Input type=date is not showing date on chrome for string value

When Json object comes from Server, date is always stored as string. We need to show that date value in Input box to allow Edit/Update of object. But <Input type="date> only understands ...
0
votes
1answer
35 views

Is it possible to have an ngOptions dropdown expand on focus?

If I click on a then the ngOptions list is expanded. Is it possible to get the same behaviour onFocus during keyboard navigation?
1
vote
1answer
27 views

Object and string do not work in the same way when using transclude property

I've read some articles on how different scopes are used when using directive's transclude property. While debugging my code I've created following code snippet. The weird thing is that _object and ...
0
votes
0answers
21 views

Cell Splitter for Twitter Bootstrap Grid System

I have a bootstrap grid with one row and two columns, now I want set splitter between those columns. My code looks like this. <div class="container-fluid"> <div class="row"> ...
1
vote
0answers
26 views

angular $window directive applied to multiple dom elements

I've spent today trying my hand at my first directive, and it works to a point, but I need more. The idea is that my app will have some looong tables, with nested tables. I'd like to be able to ...
0
votes
1answer
24 views

AngularJS How to call a function if any of the text area changes

I want to call a function if any of the textbox ( textarea) changes. I know that I can write use onChange, but then I will have to write it for every text. Any better way to do it. It would be really ...
0
votes
0answers
8 views

Angular optimisation: does it make sense to use bindonce on root DOM element, such as body?

Does it make sense to use bindonce on root DOM element, such as body?
0
votes
0answers
40 views

Angular directive won't remove html added to element

I have a directive that is added to other elements which is used to inject html as a popover. When any of the buttons in the popover that are added are clicked, the directive should remove the ...
0
votes
0answers
29 views

Unable to display selected option in angular JS Select

I have a JSON string with the follow structure {section: category: option:[ {option1}, {option2}, ...
0
votes
1answer
25 views

how to make ng-click from within a ng-repeat affect outer scope

I am on the following situation, I have an element which adds a class through ng-click in other elements. Some of then are within a ng-repeat loop with its own scope... Something like that: ...
0
votes
0answers
36 views

Angular custom directive only loads once

I have an angular custom directive that works the first time it's loaded on the page. When I leave the page and go back to that page it doesn't load again but the controller for the page does. The ...
0
votes
1answer
21 views

unbind an angular element

I have the following code inside of a directive and I want to make sure it gets cleaned up when the scope is destroyed. I've looked online as well as the code and I was wondering how do I unbind an ...
2
votes
2answers
16 views

Angular directives. can I cancel a directive with a lower priority

lets say that I have an element with a couple of directives. for example: <div myFirstDirective='someFn' mySecondDirective></div> (myFirstDirective has a higher priority than ...
0
votes
0answers
29 views

Can AngularJS directives and scope variables be simplified

Senario I want to write a simple Angular directive that has a directive name (as an attribute) that can be used as a variable as well (ie. data-directive-name="some value" where we can use "some ...
1
vote
1answer
32 views

AngularJS dynamically added directives

I have the following compile : function($scope, $element, $attrs, parentCtrl) { return { pre : function($scope, $element, $attrs, parentCtrl) { if($scope.feature == 'drop') { ...
1
vote
1answer
35 views

Recursion directive not working

I am trying to create a custom recursion directive. But it's not working I followed the approach defined here Recursion in Angular directives Here is the fiddle http://jsfiddle.net/x6kvwzuk/ Only ...
0
votes
0answers
11 views

Animate a route change only after the new route has fully rendered

I'm trying to animate a page transition in an AngularJS app. I'm using a ng-view container. I have injected the ngAnimate module to my app, and the route change animation works as expected when the ...
2
votes
0answers
25 views

Is it possible to use $compile in Angular to create an exportable elem?

Is it possible to create an elem/string which gets compiled by Angular which I then can send to another part of the application which is outside of angular? var eventListElem = ...
0
votes
1answer
24 views

How to bind a method in a custom directive to the parent scope in angularjs

First foray into custom directives and getting a bit stuck on binding to a method in the parent scope. So when I use my custom directive in my app: <dropdown x-label="Stuff" x-divider="-" ...
1
vote
1answer
21 views

Can Angular ng-if check if the value contains something?

I got the following in my template: <td ng-if="invoice.paymentMethod == 'automatic'">{{ invoice.paid | date:'yyyy-MM-dd hh:ss' }}</td> <td ng-if="invoice.paymentMethod != ...
1
vote
1answer
25 views

AngularJs API references

When i look up the API references of AngularJS, the directive uses capital Letter in the API documentation and without hyphen for example ngApp is not like ng-app When we code it we code it like ...
0
votes
1answer
34 views

AngularJs Radiobox group Validation

Is there a simple way with Angularjs to Validate a radiogroup that has been instanciated in an extra directive ? Validation requirement: The User cannot submit unless one of the radioboxes has been ...
0
votes
0answers
23 views

Both “clickable” and “draggable” area

I have a list of element inside an ng-repeat for which elements are clickable and draggable : if I click I display, and if I drag ... I drag the element. When dragging I am displaying a circle with ...
2
votes
1answer
49 views

validate file size before upload for input type=file using angularjs

I have an input type=file element in my form. I want to create a custom directive for checking the file size as soon as I select a file using the input element. I know how to create a create a custom ...
0
votes
0answers
32 views

Why is the ng-model attribute attached to the replacing template?

Suppose this directive: <myDirective ng-model="test"></myDirective> and the main excerpt of its definition: return { require: '?ngModel', restrict: 'E', ...
0
votes
0answers
33 views

angularjs loading directive works part of the time

In order to standardize loading warnings, and avoid changes in a page when http ajax requests come back and change $scope item values, I set up a simple directive to wrap an element and add "loading" ...
0
votes
3answers
18 views

Simple Dynamic Directive AngularJS

I have an application that uses an independent directive not tied to the application in anyway but can be called with $scope.$emit() from anywhere. I would like it to load an internal dynamic ...
0
votes
1answer
21 views

Nested angular directive with calculation on parent scope data

I have two directives one is a 'fancy display' on a calculation from the parent - they are nested because sometimes the child is a child and sometimes it is independent. <parent> <reuse ...