Tagged Questions
0
votes
3answers
16 views
AngularJs behavior button
I have a button:
<button data-ng-click="toggleElement(asset)" class="btn"><span class="text-center">Add To Cart</span></button>
I would like to hide this button when ...
0
votes
0answers
19 views
How to set parent scope for ngInclude
I have a directive that needs an isolated scope for its work
one of the parameters it receives is a templateUrl that it pass on to ng-include
Is there a way to tell ng-include to generate its scope ...
0
votes
1answer
21 views
AngularJs $compile finish / end event
Hi I would like to know,
if there is a way to get something like promise (i guess it will be postLink in this case) on $scope.
i an unanswered question here: AngularJS: how to know when the $compile ...
0
votes
0answers
37 views
Passing scope through an angularjs directive
I want to create a reusable directive that passes the parent scope through the directive to it's child scope.
For example, I want to dynamically set the height of a container so that it can be ...
0
votes
2answers
32 views
Angularjs isolate scope fails in undebuggable way
Ok, so im really struggling with trying to use isolate scopes with an angular directive.
Here's the html, assume i have a valid array in the objectivesJson property:
<div lesson-plan ...
0
votes
1answer
27 views
How to remove deleted row in ng-table
I have a grid developed using ng-table and I need to remove selected item from grid table after removing from server-side. Already tried to call the grid loading ajax again, but it's not working.
My ...
0
votes
1answer
33 views
Equivalent of Knockout Applybindings In AngularJs
I am using knockout since 2 months and now I am reading and trying to learn angularJs. In knockout I was creating some data dynamically using jquery. Which depends on the data which I receive from the ...
0
votes
1answer
16 views
AngularJS Chart Directive - Data loaded in async service not updating chart
I am having one chart directive created, and I am bootstrpping the app after loading google api. In following code, a simple data table is working fine. But when I load data from server in async ...
2
votes
3answers
42 views
Get AngularJS to compile directive and link function before executing the controller
Due to the nature of my program, I require functions to be placed on the scope and shared between the directive's link function and the controller, like so..
.controller("controller", ...
0
votes
1answer
71 views
ngModel data binding is not working properly
I am using ngSwitch directive to switch the view to Edit the div content. HTML is as follows -
<div ng-switch="isEditing" ng-controller="descController">
<div ...
1
vote
3answers
51 views
AngularJS: Binding boolean value to radio button such that it updates model to false on uncheck event
In my AngularJS application, I am displaying contacts data in a grid. My typical contacts JSON looks like as below ...
[
{ type: "IM", value: "mavaze123", default: true },
{ type: "IM", ...
1
vote
1answer
55 views
AngularJS converting object to string in directive
I need some help with getting AngularJS to maintain my non-string values in directive attributes.
I was looking for a way to render a tree structure in HTML from a piece of JSON, and I found this ...
0
votes
1answer
27 views
Highcharts-ng directive (Angular) not updating
I'm using highcharts-ng Angular-JS directive to draw a chart on my page.
I am hoping to be able to update the data in my controller, and have these values reflected in the graph. However, when I ...
0
votes
0answers
41 views
AngularJS Object 0 has no method 'match' Directive Isolate Scope [on hold]
This is more of an answer for others who may be having the same issue. Also wanted to get some feedback on Isolate scopes and what you can not do in the actual scope object.
My AngularJS app started ...
0
votes
1answer
43 views
Angularjs: Updating a directive scope variable from controller not working
I'm new to angularjs and have a bit of trouble trying to do this simple task of updating a scope variable I set in my directive in the calling controller.
So I have a directive:
...
1
vote
0answers
69 views
Modify model of parent scope in a directive with '=xxx' isolate scope?
I have an Angular directive which permit to render an user, and create a link to view the user profile, declared as:
.directive('foafPerson', function() {
return {
restrict: 'E',
...
0
votes
1answer
27 views
How to pass data from directive function to service?
I'm trying to build a very simple toy 'calendar' application in angularjs. It really is very simple - a list of days with functionality to add 'appointments' to any day via a 'add appointment' link.
...
0
votes
1answer
38 views
Angularjs isolated scope for directives without own template
I want to create reusable directive in AngularJS without own template. I also want to have isolated scope for that directive. What is the best practices for my approach?
Why my example doesn't work as ...
0
votes
1answer
36 views
ng-click executing 2 methods that belongs to different controllers
I have a controllers with name PostController and CommentController
PostController having the function showPost
CommentController having the function showComment
i want to execute the both the ...
1
vote
1answer
30 views
Scope.attribute available but scope.attribute.variable undefined in directive
I'm trying some angularJS development, but I'm facing a issue that I do not understand at all.
I try to format a JSON into a specific table with many rules. For now my JSON look like:
{
...
0
votes
2answers
36 views
Cannot obtain proper data in angular JS
I have done the following in AngularJS. The data is obtained from the URL mentioned.
If you open the URL, you can see the response it provides.
However, I am not able to obtain the title inside HTML ...
2
votes
2answers
50 views
Did I share state correctly outside angular directive? (parent scope / $rootScope issue)
I have two elements on my page which are not nested in some way. With attributes on the first one, I would like to set the content of the second one, like so:
<body>
<input info="This is ...
0
votes
2answers
50 views
Angular Directive refresh on parameter change
I have an angular directive which is initialized like so:
<conversation style="height:300px" type="convo" type-id="{{some_prop}}"></conversation>
I'd like it to be smart enough to ...
2
votes
2answers
60 views
watch ng-model inside directive
I have the following directive:
directive('myInput', function() {
return {
restrict: 'AE',
scope: {
id: '@',
label: '@',
type: '@',
...
0
votes
1answer
28 views
Add and remove directives easily
I'm looking for a way to dynamically add and remove directives. After digging around I suspect I'll need to use $compile to bind a directive to an element, however I'd like to do this without ...
0
votes
1answer
36 views
Trouble iterating, and parsing application data
I am working on my first AngularJS web-app and have been stuck trying to iterate and parse some data. I am trying to display how many users (and ideally their name) are currently connected to my ...
1
vote
1answer
38 views
AngularJS directive link function not being called
I am trying to use angular-http-auth library with bootstrap modal window. Modals are working fine but I have problems with directives.
Here is a jsfiddle link - http://jsfiddle.net/jCUSh/85/ . I am ...
0
votes
1answer
32 views
Angularjs : accessing service methods from directive's link function
i have a directive, and in its link function i want to access methods from a service. My code for directive is
AppDirectives.directive('feed',['FeedService',function() {
return {
restrict : 'AE',
...
1
vote
2answers
60 views
Angular js directive and repeater issue
i have this piece of code here
var app = angular.module('app', ['ngRoute'])
.directive('loadObject', function (repository, $rootScope) {
return {
scope: {
loadObject: '@'
...
0
votes
1answer
53 views
AngularJs : Passing parameter to ng-click in directive
I have a directive in which i am adding an a button and an ng-click on the button. My code for directive is
AppDirectives.directive(
'feed',
function() {
...
0
votes
3answers
34 views
How do I change a variable in MainController from PartialController? (angularjs)
I have a partial view that is using angular. How do I change a variable in the MainController from PartialController? I am not sure how to create the interdependence...
...
0
votes
2answers
46 views
AngularJS ng-model in template passed to directive controller
I've got a directive with a controller, that builds a form for posting comments to an API via CommentsService
My directive looks a bit lik this:
app.directive('appComments', function( CommentService ...
0
votes
0answers
38 views
Difference between template and templateUrl in angular js directive in isolated scope
I have a directive in isolated scope and i define a couple of variables in link function of the directives so the template fails to bind to these variables but templateUrl seems to bind to these ...
0
votes
1answer
32 views
Unable to call locally declared scope function via ng-click in a directive
I have a directive (Just a button).
This directive has an isolated scope.
I want to update the object in my parent scope by clicking on the button.
But the function is not being called.
This is the ...
0
votes
1answer
37 views
Dynamic ng-model binding inside a directive
I'm trying to create a custom component that uses a dynamic ng-model inside-out the directive.
As an example, I could invoke different components like:
<custom-dir ...
0
votes
3answers
39 views
Call controller function when directive attribute changed
My code so far:
.directive('ngSpreadsheet', function () {
return {
restrict: 'EA',
scope: {
curpart: '='
},
template: '<div ...
1
vote
2answers
38 views
Angularjs Sharing controller between directive
While implementing angularjs directive i have got some issues in sharing controller between directive
i cant access the enterUser directive from the below controller
app.directive('entires', ...
0
votes
3answers
89 views
Exporting methods from an angular factory or directive to use later
I have developed a web application using Angular.js (It's my first). The application features a collection of interactive graphics (seat maps); so I created a module to handle the Raphael stuff, ...
1
vote
1answer
44 views
Rendering directives within $sce.trustAsHtml
I've included a Plunker here: http://plnkr.co/edit/4vqV8toHo0vNjtfICtzI?p=preview
I'm trying to add a button to the DOM and when clicked should execute the function bound to it. In this case it ...
0
votes
1answer
28 views
Angularjs call synchronization
I am using angularjs get method to get array of feeds from server. here is my controller code.
$scope.feeds = new Array();
$scope.feeds = FeedService.getFeeds();
console.debug("in controller ...
1
vote
0answers
52 views
AngularJS: Accessing current object in ng-show function for recursive directive
Given the following code:
http://jsbin.com/EkIqAju/2/edit
How can I access the current object being evaluated in the showQuestion() function in the controller?
I need this to be able to validate ...
0
votes
0answers
20 views
Isolated scopes for multiple dialogs in AngularJS
I have a dialog box where i display a list of results.
I open the dialog box like this:
var dialog = $modal.open({
windowClass: "leaf-data in",
...
0
votes
1answer
46 views
How to stop propagation of & functions into nested directives
here I got one ctrl
controllers.ctrl = function($scope){
$scope.trData = [
{name : 'elem1',children : []},
{name : 'elem2',children :
[{name : 'elem3',children : []}]
}
};
...
1
vote
2answers
45 views
angularjs ng-repeat doesn't process linebreaks
Hi I'm building a chatapp in angularjs and my autoscroll scrolls all the way down to the bottom of the chat box like it should when there are no linebreaks in the message. However, when there are ...
1
vote
1answer
34 views
Assignment in an expression
I'm trying to make a directive which receives expression as a callback to bootstrap's 'hidden.bs.modal' event:
//the use
<div class="modal" modal-on-hide="currPane = 'firstPanel'">
//the ...
0
votes
1answer
49 views
Understanding ng-show in AngularJS directives
Given the following code:
http://jsbin.com/uYETOSUM/2/edit?html,js,output
I want to only show the first dropdown first (parent question in JSON). After user have selected an option I want to show ...
2
votes
1answer
41 views
angularJS directive with isolated scope, attribute binding doesn't work
Please see this jsfiddle: http://jsfiddle.net/viro/DK5pC/3/
What I did looks right compared to the tutorials and replies I've found, so I'm sure I'm overlooking something trivial.
I'm trying to do a ...
3
votes
1answer
50 views
How to Dynamically add Direcitves angularjs
I have successfully Added an angularjs directive into another directive using this code
var newElement = $compile( "<div my-diretive='n'></div>" )( $scope );
$element.parent().append( ...
0
votes
1answer
34 views
AngularJS ng-disabled directive with expression is not working
User Story: When a new user clicks the New User checkbox and accepts the TermsAndConditions radio button, the Register button should be enabled.
My code in angularJS isn't working. The Register ...
0
votes
1answer
51 views
Angular js factory and injecting factory in normal javascript to make it modular
I have created a factory to invoke Rest services using $resource. The factory function is used multiple places in my code and is based on the usage I need to use for different callbacks. I want to ...