The angularjs controler exposes the data that is to be displayed into the html view. It plays the essential role of the ModelView in the MVVM design pattern. The view is a part of the Html template.
3
votes
1answer
375 views
Nested directives - cannot pass args to controller method from child directive in Angularjs
I'm having some trouble with nested directives in angularjs. I want to call a controller method from a directive within another directive and am trying to pass arguments to it, however they are ...
2
votes
1answer
63 views
How to dynamically load controller to a directive
So I have a directive that Will be acting as a side panel in my app. When a user clicks a button the side panel will open. In said side panel I need the controller and view for this area to be ...
2
votes
1answer
1k views
Argument 'PricesController' is not a function, got undefined
I am relatively new to angularjs so please bare with me. I have looked at a lot of examples related to setting up the app, and everything I'm doing seems correct but I'm still getting the error ...
2
votes
1answer
95 views
What is the difference between passing a function and array as an AngularJS controller?
Both of these work, but what is the actual difference between each implementation? I'm sure there is a logical reasoning behind each method, and I wish to be enlightened.
...
1
vote
1answer
17 views
How to remove repetitve function from angularjs controller
Hi i am writing some code staff under angularjs but i has to make duplicated code from controller to other for example let's assume that we have two controllers editProductController and ...
1
vote
1answer
120 views
How am I supposed to pass data from serverside controller an AngularJS controller?
I've encountered what I believe to be a common scenario, in which I am using an MVC pattern (specifically ASP.NET's MVC framework) for a web application, with AngularJS on the front-end. My problem is ...
1
vote
1answer
55 views
ng-include directive and ng-controller option with variable
I have a question about using ng-include and ng-controller together. In the same element, the ng-include and ng-controller are at the same element, I take the url to do modification.
...
1
vote
1answer
138 views
Controller function calls more than once in AngularJs
I am making mobile application with using JQuery Mobile and AngularJs
I am currently using single page structure here is my sample
<body ng-app="myApp">
<div data-role="page" ...
1
vote
1answer
31 views
Angular not scoped method
I am wondering, does all the methods declared in an angular controller have to be added to the scope?
is it possible to call a controller method from ng-click="myMethod()", with my method not delared ...
0
votes
1answer
16 views
Directive talks to controller but cannot call functions residing in controller
I have a directive which needs to call functions from the Main controller but everytime i try to reference a function inside the directive nothing happens because it's undefined. When I access a value ...
0
votes
1answer
11 views
How to append a directive to another directive which calls a function from controller.
I'm trying to append a directive which occurs when an event is fired via the $watch function in angular. The first directive updater would insert a custom element <confirmation /> into my view. ...
0
votes
1answer
29 views
Initiating directive from controller
I'm having trouble figuring out a way to initiate a directive once the data has been returned. I'm trying to build a report using html tables and ng-repeat. The report object is generated using a ...
0
votes
1answer
57 views
Routing with controllers in these html pages, is it possible?
I'm new in AngularJS development and I'm actually in front of a problem.
In my index.html I have already many scripts included like that :
<script type="text/javascript" ...
0
votes
1answer
45 views
Passing a callback form directive to controller function in AngularJS
I have a directive and a controller. The directive defines a function in its isolate scope. It also references a function in the controller. That function takes a callback. However, when I call it ...
0
votes
1answer
53 views
ng-repeat duplicating items after page reload
I have an angularjs application, with a node.js and express backend, so I'm not using angular's routings. When I refresh the page using the browser's refresh button, my Items on the page that are ...
0
votes
1answer
30 views
Angular app not working when web browser refreshed
I have an angularJS app, It is working well till I refresh my web browser.
In my application, there is a JSON object that I get based on my login. It got a secession ID and a set of arrays in it. ...
0
votes
1answer
21 views
Change ng-model through directive
I'am trying to change ng-model of input inside directive by clicking on Edit anchor in directives template.
Function f() is suppose to access outer controller and bind the editableValue to name or ...
0
votes
1answer
99 views
Pass multiple php variables to scope object list
I'm new to AngularJS and decided to try it out. As I read about it that I can simply plug into existing HTML and it will work. And now I'm stuck at this point.
Here is my shortened PHP code with ...
0
votes
1answer
141 views
Angular ng-grid - How to remove row after submit in Modal
I have a grid of task items loaded by ng-grid that when clicked load more information in a Modal window, of the user clicks Submit then the task is set to inactive in the DB and I need it removed from ...
0
votes
1answer
47 views
Angular.js: No controllers
I'm just trying to get a simple example going with angular but the oddness of the provisioning conventions have me stymied.
It appears I'm doing the right thing, I can see Angular in the DOM. But ...
0
votes
1answer
421 views
Angular.js best practice - extending controllers, overriding controller defaults
Here is a real-life Angular problem I can't wrap my head around.
I love Angular, but this issue is bugging me a lot right now.
I'm doing a dynamically generated form with Angular.js.
Everything ...
0
votes
1answer
52 views
How do I access the controller I declared for an angularjs directive in the templateUrl?
I would like to use a directive with a controller but I would like to access the same controller in the url template. How can I do this? For example, I would like something along the lines of:
...
0
votes
1answer
95 views
AngularJS Redraw issue? Chrome only
Super new to AngularJS so please be patient with me :)
We're using it to poll our API for updates while we process a repository (and after). On one particular page the data is loaded but not drawn ...
0
votes
1answer
48 views
Directive Inside another directive. Controller can't watch
I have 2 simple directives...
the parent directive:
.directive('modal', [function () {
return {
replace: true,
scope: {
/* attributes */
},
templateUrl: 'modal.tpl.html',
transclude: ...
2
votes
0answers
980 views
Getting AngularJS Error: “[$rootScope:inprog] $digest already in progress” without a manual $apply
Other posts on this error always include someone trying to $apply without using a safe apply, but that's not the case in my example. My function IS successfully returning the data I requested from the ...
1
vote
0answers
43 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 ...
1
vote
0answers
78 views
Using Restangular to add items from a nested array into an object in Angular.js
I have a model. The model has lot's of potential nested arrays. The item is a task and I can add a category to it for example.
When I'm doing a new .POST how do I get the item's from the nested array ...
1
vote
0answers
384 views
AngularJS - “10 $digest() iterations reached” when ng-view ng-repeat dependant on $routeParams
I am really new to Angular and this is the first time that I am dealing with routing, so please excuse me if my questions are a bit confusing. My actual logic and structure for this app is much more ...
0
votes
0answers
8 views
AngularJS communicationg between services and controllers
I am new to AngularJS. Having problem with service and controller. I have a service and have delete method. What I want to do is to return true when $http.delete successfully got response from server, ...
0
votes
0answers
5 views
$scope.$digest throwing“No more request expected ” in angular controller unit test
Controller code :
$scope.$watch('model.time_zone', ((newValue, oldValue) ->
return if (newValue == oldValue)
if newValue == originalTimeZone
$scope.timeZoneChanged = false
else
...
0
votes
0answers
27 views
detect which directive calling a method in the controller
is there any way to detect which directive calling a function in the controller without passing any arguments from the directive itself.
simple example to demonstrate what i need:
controller:
...
0
votes
0answers
129 views
angular directive for tables: bind transcluded elements with ng-bind-html
I'm trying to write a generic table directive like this:
<h-table rows="customers">
<h-column field="Id">
<a ng-click="editCustomer(row.Id)">{{row.Id}}</a>
...
0
votes
0answers
150 views
excel file not getting after returning from Angularjs Service
I have situation where i have to call angularjs service method to post data to C# controller which in turns return me excel file which i want to save.
here is code....
HTML :
<div ...
0
votes
0answers
63 views
Controller Design in AngularJS
I'm trying to follow some best practices outlined here:
http://trochette.github.io/Angular-Design-Patterns-Best-Practices/#/inheritance_pattern
And building my controller like so
...
0
votes
0answers
59 views
Leading/trailing slash in base url in angular controller
Our application running on following url format http://<server>/<app_name>/<private>, also this format http://<server>/<app_name>/<private>/ is working for us.
But ...
0
votes
0answers
34 views
ng-if / manually binding controller causes DOM Node count increase
I'm writing a directive to bind a template with a controller dynamically.
During this, I found that the DOM Node count kept increasing, (and the heap size too).
I'm wondering what is wrong with the ...
0
votes
0answers
37 views
Should i set controller on directive or on the state config
I have a question concerning the location of placing a controller on my angularJS app.
this is a snippet of my app.js:
var myApp = angular.module('myApp', ['ui.router', 'ui.bootstrap']);
var ...
0
votes
0answers
54 views
Clear form after submit and disable form in angular service
I create a service to upload content.
it takes 4 argument
which folder to update
the content
set the form to disabled
clear form after submit
create: function(folderID, text, o, master) {
...
0
votes
0answers
681 views
Setting Model in AngularJS Control Not Updating View (something…)
I am experiencing issues with updating values in my AngularJS controller and having them properly reflecting in my model.
I have the following form in my view:
<form name="formSignIn" ...
0
votes
0answers
251 views
ng-repeat load new updated array model but do not clear the previous value of array in template
I have a list of articles, every article has a list of comments with user.name and user._id of that comment. Click to each user, it shows a chat box to send message to that user. Everything is ok with ...
0
votes
0answers
211 views
Dynamic routing with dynamic controllers in AngularJS
I am currently using require.js and angular. Since I have a very long list of custom views, each for a different task, I've cooked up a way of including them dynamically using requirejs.
First a ...
0
votes
0answers
321 views
How can I write generic Angular JS controller logic?
I'm using Angular JS to work on a proof of concept for a SPA that needs to be able to handle dynamic form generation. This project is essentially an interview style application that will have a user ...
0
votes
0answers
225 views
AngularJs :: Load Data In DropDown on base of other Dropdown
Load data in my first dropdown from AngularJS then on the basis of this dropdown i want to generate next dropdown with data from another controller
<ul data-role="listview" data-inset="true">
...
0
votes
0answers
121 views
How to have page controller execute directive functionality AngularJS
Lets say I have a directive that has an isolate scope and that scope have a method on it. Now is there an Angular way to allow the page controller to be able to call functionality declared in a ...
0
votes
0answers
128 views
How to create nested views and controllers in AngularJS without using ng-controller in the attribute
I have an application wide router, where the routes specify the template and controller to instantiate while navigating:
$routeProvider
.when('/', {
templateUrl: 'views/login.html',
controller: ...
0
votes
0answers
256 views
AngularJS - Create a directive to fire an event (function) when the current element is appended to the DOM
I am trying to find a way to detect when an element is finally appended to DOM? Is there any directive that I can create and attach to that element so it will detect the moment of appending? By ...
0
votes
0answers
46 views
Trouble with editing objects in AngularJs
EDIT: the code on the plunkr works as it should, but not on my local machine, the only difference is that locally edit-website.html template is stored in partials folder, which is refferenced in the ...
0
votes
0answers
208 views
angular ui-select2: fire highlight events programmatically (without using JQuery)
is there a way to call highlight events of select2 in a programmatic way?
something like "ng-highlight"... that will enable writing the callback function of the item-hover in the controller.
...
0
votes
0answers
379 views
AngularJS: Sample ToDo App - Questions and Review
I know there are tons of AngularJS ToDo apps/topics out there and I've read quite a few of them to get a basic understanding of AngularJS, how things work and the idea people put behind their code. ...
0
votes
0answers
96 views
Share data between controllers using permalinks?
I would like to share data between controllers using permalinks, rather than signals or factories.
Given a single page application, with three controllers (Ctrl1, Ctrl2, Ctrl3), and a predefined ...