-2
votes
1answer
19 views

AngularJS : How to inject custom service in controller?

I am working with AngularJS. I have the following page : <div ng-controller="UserController"> <h4>Create an account</h4> <form class="form-horizontal" role="form"> <div ...
0
votes
0answers
6 views

Angular directive for validation using two models

Using the new $validators object on ngModel, I want to validate an input field based upon the data in the input field in addition to a checkbox. The directive works great if the checkbox is ...
1
vote
1answer
24 views

jQuery code in an AngularJS directive

I want the following element to display Google Map: <div id="map" class="gmaps" ></div> For which I have the following js added: <script ...
0
votes
0answers
23 views

Is There a better way to optimize my directive?

my code is working, but i'm wondering if there is a better way to improve it. I have a modal dialog in AngularJS, that i select multiple users. Openig the modal: $scope.openModal = function () { ...
0
votes
1answer
20 views

difference between '@' and '=' when testing directives

I'm trying to get my head around testing directives at the moment and have come across some strange behaviour. My code is as follows: angular.module('tddApp', []) .directive('oddsButton', function ...
1
vote
1answer
20 views

attribute directive on title tag in IE8 does not run

See below the super-simple directive that's attached to the <title> tag. In modern browsers this activates and changes the title to "Title C" but in IE8 the link function is never called and the ...
0
votes
0answers
10 views

AngularJS Directive Select not getting selected on modal update

I am having a directive which shows a select box with all jobs. Here is my directive: app.directive('jobsSelect', function($job,$compile){ var getTemplate = function(attrs) { ...
-1
votes
0answers
16 views

How to add ng-click directive to dom element in java script

I have a Button which is being included in the page via jsp include . <button class="btnGreyInactive" name="btn_createNew" id="createNewBtn" style="display: inline-block;" ...
1
vote
1answer
11 views

AngularJs - Use filter with ng-bind in directive

I have a simple directive like that one : Directive js : .directive('pageHeader', function() { return { restrict: 'E', scope: { title: '=', subtitle : ...
0
votes
0answers
8 views

How to add infinite scroller extension to angularjs.datatable

I am trying to implement a grid using the angularjs datatable(http://l-lin.github.io/angular-datatables/#/gettingStarted). I want to implement the scroller plugin available with jquery datatables. Is ...
0
votes
2answers
26 views

AngularJS custom table directive

I have made a table with AngularJS all is working good pagination and sorting but i want to make it as a component so that in other pages it can be used. Right now i have made a factory which calls my ...
0
votes
0answers
10 views

Google Map with AngularJS: Cannot read property 'Pool.<InfoWindowView>' of undefined

I have the following div element where I am trying to show a Google Map with a lat and lng value. <div id="map" g-map class="gmaps margin-bottom-40" style="height:400px;"></div> I've ...
1
vote
0answers
10 views

Dynamic placement of Angular-Strap datepicker

I've got a problem with angular-strap datepicker placement field. Is there a way to make the placement attribute dynamically so that it doesn't overlaps with the window height.[bottom,top]. This is a ...
0
votes
1answer
21 views

How to check if expression will have a value after evaluating

Let's say I have a following template: "foo['x'] = '{{ myVar }}';" Is there an angular way of checking if evaluating this against my current scope will give myVar some value ? I've got an array of ...
0
votes
0answers
16 views

AngularJS Partial Directive Dropdown Not Working

I am adding a dropdown to a sidebar that I am loading as a directive partial template. All the css is loading fine from my base.html but the dropdown is not working in my sidebar.html. If I cut and ...
1
vote
3answers
39 views

AngularJS directives data binding doesn't work

DEMO Here is a simplified version of the two directives I have, my-input and another-directive: HTML: <body ng-controller="AppCtrl"> <another-directive> <my-input ...
0
votes
1answer
26 views

Angularjs division by scope variable fails

I use angular-timer. This works: {{(seconds/10)*100}} But this one does not: {{(seconds/secondsToAnswer)*100} (it evaluates to NaN) However, I set the secondsToAnswe to 10 in the ...
0
votes
1answer
17 views

angular directive scope: setting a default value

I'm creating a datepicker directive, part of its markup is: <select class="form-control" ng-model="day" ng-options="day.nr for day in allDays"> I'm trying to define allDays in the scope ...
0
votes
1answer
29 views

Multiple Parent Directive Instances

I am trying to create a pair of directives with a parent child relationship. I found that '^require' works well for this but the issue is I would like to have multiple instances of the directives on ...
0
votes
1answer
32 views

Parsing the value of an input in angular breaks when using angular 1.3.x

Using angular 1.3.x, I have a parser in a directive assigned to an input. When the user enters text into the directive the function that has been pushed to the $parses array is run. However when ...
0
votes
0answers
37 views

Ngshow/hide based on ajax return value

Does anyone know of a way to dynamically use ngshow to show/hide content based on an ajax return value? This is what I have so far: $scope.loggedShow = false; var user = ''; $scope.login = ...
0
votes
1answer
14 views

AngularJS: How to inherit the scope the directive locates in, and get attributes value same time

Could anybody help with this? Is there a way to access the scope the directive located in (e.g. a controller's scope) while I still can access the attributes' value. here is my directive code ...
0
votes
1answer
31 views

Load directives based on value

my issue is that I have a directive as follow: app.directive('bottomNavBar', [function () { return { templateUrl: 'views/bottomNavBar.html', restrict: 'A', replace: true, transclude: true }; ...
0
votes
1answer
23 views

AngularJS controller as and this instead of $scope calling $apply in directive

I've been using the controller as syntax and this instead of $scope in my Angular project and ran across an issue using a directive. I'm trying to call a function in my controller using ...
0
votes
1answer
24 views

Multiple directives need to share same private scope

I have two directives, one is restricted to the element and the other to an attribute <bar-foo special></bar-foo> Now the issue is that the special directive need to define something on ...
1
vote
2answers
47 views

Datepicker does not update ng-model

So, I've put together a very simple datepicker: HTML: <div ng-controller="DatepickerCtrl"> <div style="display:inline-block; min-height:290px;"> <datepicker min-date="minDate" ...
0
votes
4answers
48 views

Angular way to Show Hide Divs similar to Tabs but without Tabs

I'm trying to achieve Tabs like functionality using Divs whose Div Id is generated using ng-repeat. <div class="col-md-10"> <div id="div{{$index}}" class="targetDiv" ...
0
votes
0answers
18 views

Fixed columns and header with Angular JS

I am having trouble implementing the following: 1. Fix the header of the table 2. Fix first 4/5 columns to freeze and the rest to scroll horizontally 3. The table should be inside a div which is of ...
0
votes
1answer
25 views

Using a directive to display and populate a select list

I've just started using Angularjs and I'm trying to get a list of credit card types displayed in a select list. I'm getting this error I'm getting (unfortunately stackoverflow wouldn't let me link to ...
0
votes
3answers
42 views

Angular input value not changed. i.e oldValue == newValue

Angular adds 'ng-dirty' class to input field when the input field is modified irrespective of whether newValue==oldValue or not. i.e. if the input value is 'manohar', and i delete 'r' and add it ...
0
votes
1answer
38 views

AngularJS: Behavior of $valid in Firefox vs. Chrome

I'm currently working on a custom validation directive. It runs smoothly on Firefox but then I decided to test it on Chrome and IE and wondered why it won't work on either of them. After adding some ...
0
votes
1answer
16 views

custom directive within ng-template does not work

I am using script tag with ng-template for displaying my form in modal dialog. I am using angular ui $modal service here. My issue is, when I pass templateUrl argument to $modal service with my ...
2
votes
2answers
25 views

How to set up angular directives that depend on shared objects loaded via ajax?

I apologize in advance if my question sounds naive (I'm an angular noob). But here is my problem: I have 3 objects loaded via Ajax that are shared across all directives on my page (I made a factory ...
0
votes
1answer
13 views

AngularJS - hide table template until form submitted using custom directive

I have the following code that makes a PUT request and displays the modified data returned from the server in a table. Right now, when the page is loaded, an empty table is displayed until the button ...
0
votes
1answer
11 views

What is Default Header Cell Template of UI-GRID?

Referring NG Grid documentation we find default Header Cell Templates Similarly What is the default header cell template for UI GRID ?
0
votes
2answers
33 views

What are some ways to display JSON data in Angular in a non-tabular format?

I've hit a bit of a brick wall with an web application I'm writing and would really appreciate a nudge in the right direction from those of you who have more experience than me with Angular. Here is ...
1
vote
1answer
35 views

How to get field that made form dirty in angular?

Is there any way to know what field made the form dirty in Angular? I have an "auto save" directive that checks if there was any change inside the form, and saves it accordingly (trough server ...
1
vote
1answer
23 views

Angular Directive param value array

How can I use a array witch is given as attribute of an directive in the linker of the directive [ { "state": "bootstrap.formwizard.ethernet", "placeHolder": "lNetworkConfWizardMenu", ...
0
votes
0answers
13 views

Nested tree view menu with directives

I have to create a sidebar menu that has two or three levels and that the developer can enable or disable some features, such as icons, labels and animation. I have created four directives, one for ...
0
votes
1answer
32 views

Why AngularJS re-triggers 'link' function of custom directive when model changed?

Plunker: http://plnkr.co/edit/01BRRI?p=preview Purpose: build a directive that edits data and save back to controller scope. Code description: $scope.object is data in controller, I referenced it ...
1
vote
1answer
26 views

Loading one directive from another

I have two custom directives, as shown below: app1 and app2. app2 should be shown only when I click on a specific button in app1. What's the best way I can achieve this? Here's my code: ...
0
votes
0answers
35 views

Using different controllers on the same directive in AngularJS

I have created a directive and service that combine to create a pop-up modal in our application. I can call the pop-up service which sets up a scope variable and causes a modal directive to become ...
0
votes
1answer
7 views

Append directive to body

I have a popup directive, and I would like to compile and append it to body. Is there a simpler way then recompiling and appending directive to body. link: function (scope, element) { ...
0
votes
0answers
19 views

AngularJS: Having a directive which should act like a native select

I'm trying to create a directive which should act like a native select. That means if I have set the required attribute, it should be invalid if nothing was selected. So far I have the following ...
0
votes
1answer
43 views

Angular directive that watches a propertie

I like to write a small Angular directive that hide or show an element if the user is logged in. The authentication factory that I inject, basically reads and writes values to a cookie. The problem ...
0
votes
0answers
32 views

Using scope in Angular directive templates

I have a problem in that I need to toggle some classes based on a value that can only be determined once the template has been compiled. That's probably not a very helpful description but I'm not ...
1
vote
1answer
36 views

AngularJS: How to implement a directive that outputs its HTML?

I'd like to create an example directive that appends its inner HTML to itself. So, this: <div example> <label for="name">Name:</label> <input id="name" type="text" ...
1
vote
2answers
39 views

Angularjs unknown provider in $templateRequestProvider

I am including other html files as template in index.html. For this i am using ng-view directive. But i am getting an error: Unknown provider: $templateRequestProvider <- $templateRequest <- ...
0
votes
1answer
27 views

Update cached templates

I make use of templateUrl and it works great! app.directive('myDir', function() { return { templateUrl: 'partials/directives/template.html' }; }; However... when I make changes to ...
0
votes
0answers
24 views

Angular JS (bootstrap UI), google maps not showing corectly

I am trying to add google map in twitter modal, only first time map are loaded, from second time map are not loaded into modal. This is my directive. appDirectives.directive('mapDirection', function ...