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
129 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
166 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" ...
2
votes
1answer
2k 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
106 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
31 views
AngularJS, Using a Service to call into a Controller
I am new to Angular, what I would like to accomplish is: From a Service / Factory to call methods directly into a controller.
In the following code, I would like from the valueUserController I would ...
1
vote
1answer
95 views
Sharing a controller scope between two directives with isolate scopes in AngularJS
I have two directives that provide different views on the same set of data. Both of these directives need to rely on central functionality contained in a controller. The controller uses various ...
1
vote
1answer
113 views
Factory property is null when accessing directly from controller Angular
I'm trying to build simple loggin with angular and rest api and I've got strange problem with checking whether user is logged in login form controller.
Here is my code:
everytime I refresh my app it ...
1
vote
1answer
71 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
179 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.
...
0
votes
1answer
18 views
Angular UI Router pausing before child state controller execution
I know that a child state / controller can wait for needed async results by adding a promise object to the the resolve object in its state description object. But using this means that the decision of ...
1
vote
0answers
40 views
getting an error : Argument 'ctrl' not defined in angular js
my index.html file has the following :
<script src="scripts/controllers/form/DashboardCtrl.js" />
<script src="scripts/controllers/chart/morrisChartCtrl.js" />
my app.js file is as ...
1
vote
0answers
189 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
706 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>
...
1
vote
0answers
409 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
24 views
Register a controller with nested controllers AngularJS
I need to dynamically register a new controller. So far I've used this code in order to do so after I've loaded the controller js files:
var queue = angular.module(moduleName)._invokeQueue;
...
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
0answers
26 views
Angular Widget using jQuery
I am trying to write a widget which will show up on button click.
This is a jQuery representation of what I want to achieve.
jQuery (This is not my code. Found this one on net)
I am not sure how to ...
0
votes
0answers
36 views
Using 2 websockets in one Angularjs controller
I have 2 websocket services: one for historical data and another for current event. Before the current event starts, I want to display historical data that loops through the years. Once the event ...
0
votes
0answers
46 views
how to fill combo box on page load in angular js?
I have a page which has two combobox in it. This is my view :
<div ng-init="loadComboBox()">
<select class="form-control" ng-model="SelectedItem1" ng-options="employee.FirstName for ...
0
votes
0answers
28 views
Dependencies no longer available in init or other controller defined functions
I have the following simple module definition:
var myApp = angular.module('myApp', []);
myApp.controller('MyController', ['$scope', '$q', function ($scope, $q) {
debugger; ...
0
votes
0answers
67 views
Error defining AngularJS Controller
I am starting with AngularJS, creating my first App & Controller I get this error:
Error: [ng:areq] ...
0
votes
0answers
28 views
can controllers be separate files while sharing data between controllers through a service?
I'm doing something like this:
How to create separate AngularJS controller files?
But I'm trying to share data between these separate controllers using a service. I'm unable to do it. Can you tell ...
0
votes
0answers
41 views
Angularjs reload part of the document
I know that the whole page can be reloaded using the $window.location.reload(); but is it possible to just reload one part of the page?
I'm building a mobile app and it loads the data from the local ...
0
votes
0answers
41 views
Angularjs - inject controller dependency automatically in $scope
Is there a way to inject automatically a dependency (or a resolve) in the $scope without manually append it to $scope ?
(with or without UI-Router)
Would the "controllerAs" syntax be of any help ?
...
0
votes
0answers
48 views
getting : undefined is not a function on getting collection from web-api
I have a web api which returns IHttpActionResult(myCollection) on Get.
My angular JS controller is has a function :
$scope.loadcollection = function($defer, params) {
console.log("inside ...
0
votes
0answers
25 views
Isolating large amounts of information into factories from controllers (AngularJS)
I'm a little new to Angular, so I'm not really sure what the standards are when it comes to writing an app that has something like this.
I had some functions and content I needed to share across ...
0
votes
0answers
71 views
AngularJS: Communicating to a controller function outside ng-view controller
Can someone help me in the following scenario..
I am developing a two page application say dahsboard and search.
In my index.html, I created a header view with header controller and ng-view to load ...
0
votes
0answers
740 views
AngularJS: $scope.array.push() does not update the view, even with $apply
I'm trying to learn AngularJS and there is this thing that I don't understand, which seems like all the internet solved by using $scope.$apply, but I already use it and it does nothing.
Basically, I ...
0
votes
0answers
16 views
Obtaining a reference to another controller function from within a controller
I want to dynamically set ng-controller within an ng-repeat. See this question for more details.
The linked question shows how to do this by defining the controller functions in the global ...
0
votes
0answers
24 views
How different controllers can relay of each other while page is being loaded?
Think about this simple scenario:
<div ng-controller="ctrl1">
... drop down list...
</div>
<div ng-controller="ctrl2">
...grid list...
</div>
The first <div> ...
0
votes
0answers
36 views
AngularJS factory and controller
little problem here, i have a controller which communicate with factories, but how can i pass the factory result to a function? Something i tried:
.controller('testCtrl', ['$scope', 'foo', 'boo', ...
0
votes
0answers
202 views
Angularjs initialize multiple controllers at startup?
i have a normal navbar with a menuController, this is the parent.
then i have two other controllers a DashBoardController this is loaded on startup and a LoadDataController this is called if i click ...
0
votes
0answers
264 views
Angular-ui bootstrap modal without creating new controller
plunk: http://plnkr.co/edit/85Wl5W If I use the $modalInstance on the same controller(modalController.js), without being in a modal, angular gets frozen.
I just want to simplify my life using ...
0
votes
0answers
33 views
Function decomposition of ngTables?
Attempt:
$scope.ran_before = false;
function table(provider, columns, params, data, parse_data) {
params = new ngTableParams
(
{
page: 1, // show first page
...
0
votes
0answers
49 views
Associating a controller with a nested template?
Angular lets me associate a controller with a template in several different ways:
With anguluar-route:
app.js
$routeProvider.when('/foobar',
{controller: "FooCtrl", templateUrl: ...
0
votes
0answers
55 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
33 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
321 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
101 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
102 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
43 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
64 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
762 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
254 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
362 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
287 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
261 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
52 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
457 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. ...
-2
votes
0answers
24 views
Angularjs - sending data using https in angularjs
I am developing an mobile hybrid application using angular js-phonegap. I want to make a post call using https. is angularjs supporting https?