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.

learn more… | top users | synonyms

0
votes
3answers
21 views

How to access an object attribute inside a service in AngularJS?

I have a service with a local variable object with events names: myApp.service('appService', ['$rootScope', function ($rootScope) { var events = { firstEvent: "MyFirstEvent", ...
0
votes
0answers
25 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
1answer
22 views

angularjs - accessing a factory from a controller in another module

This is the factory code under the myApp module angular.module('myApp') .factory('userFactory', ['$http', function ($http) { var userFactory = {}; userFactory.login ...
0
votes
5answers
34 views

Data Binding not working in AngularJS

Im now to AngularJs and i've created a test app. I'm using version 1.3.x and i have faced this problem. Here is the code for HtML and JS var angular.module('ControllerExample', ...
0
votes
1answer
28 views

How do i acces ngRoute's controller from directive?

I need acces to my controller that's provided by ngRoute in directive. Is it possible? Thank you in advance!
0
votes
1answer
23 views

How to run a directive after the dom finished rendering in Angularjs

I'm try to render the template dynamiclly, How to run the directive after {{tag}} has been rendered finished ? directive: angular.module('services', []) .directive('demo', function() { ...
0
votes
1answer
53 views

Duplicate controller when using angularjs

I'm usnig AngularJs 1.2.25. I have a route config: $routeProvider.when( '/config-root', { templateUrl: configRootTemplate, controller: "ClientConfig", } ).when( ...
0
votes
1answer
27 views

Why controller doesn't respond on route update?

I would like preserve instance of controller without reloading. I set reloadOnSearch to false and I manage route change in my controller. Here is the code. This is example of my link <a ...
0
votes
2answers
30 views

AngularJS: Bind a Service Variable to a Value on a Controller's $scope

I am creating a single-page AngularJS web app. My app needs to be able to query a backend service to get some information about a user's state, and this state information needs to be available to the ...
2
votes
2answers
41 views

passing params from controller to service in angularjs

I'm having trouble on figuring out how to pass parameters from my angular controller to service #my controller 'use strict'; angular.module('recipeapp') .controller('recipeCtrl', ['$scope', ...
0
votes
1answer
27 views

Angular JS. set ng-model correctly on repeatable select directive

Just started learning AngularJS. I wrote this controller and directive to repeat a select form item, because I need to do some server side work to populate its options. Here is the directive in HTML: ...
0
votes
1answer
22 views

AngularJS Disabling Forms When Controllers are Created

AngularJS disables (cannot submit) forms that do not have a specific action set: <form action=""> when you create a controller. It does not have this issue when creating directive or ...
2
votes
2answers
42 views

Variable updated in controller but not updated in HTML?

I'm trying to get a better handle on Angular.js. As stated in the title, I have a variable in a controller which changes values when called by a member function, however the update is not pushed to ...
0
votes
0answers
27 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
1answer
24 views

angular form name from inside associated controller

I'm very new to angular!! What i'm trying to do is get the form name from inside the associated controller or a reference to the form object from inside the controller. <form name="someName" ...
-1
votes
1answer
45 views

Confusion about data usage in Controllers

How can I use the fetched data in customersController in AnotherCustomersController function customersController($scope, $http) { $http.get("http://www.w3schools.com//website/Customers_JSON.php") ...
0
votes
3answers
32 views

Dynamically specify the controller to use in an Angular directive

I am looking to specify the controller that a directive should use via an attribute on the element - i.e. dynamically: HTML <div data-mydirective data-ctrl="DynController"></div> ...
1
vote
1answer
36 views

Directive does not have access to controller function (AngularJS)

When I declare a directive to use that accesses a controller function, it cannot find the controller. Here is my directive declared in app.js: app.directive("delete", function() { return { ...
0
votes
1answer
16 views

When use module to register controllers

I have two functional code to register controller with Angular. The first code is: In app.js: var app = angular.module('myapp', ['...']); app.config(... $stateProvider .state('first', { ...
0
votes
3answers
59 views

angularjs controller function is not getting executed

I have a controller for login and I am not sure why the function within the loginController is not being executed. When I debug thru Chrome, I can see that it is executing line (var controllerId = ...
0
votes
0answers
36 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
3answers
37 views

AngularJs - Pass Values from view to controller then to service

I have looked at similar questions, but all don't make sense. I have we api that i am going to use to login people. They provide the username and password, and then i query the api which returns data ...
1
vote
1answer
23 views

AngularJS Modules and External Controllers

I have a page containing multiple containers. Each container will have its own controller but point to one factory, which handles all the logic interacting with a web service API. I would like to have ...
3
votes
4answers
140 views

How to update a form controller in AngularJS after changing input constraints

I have been recently working on dynamically changing constraints on input fields on a form. The aim was to make a back-end-driven form, whereas all fields and their constraints are being sent to us by ...
2
votes
1answer
39 views

Why can't I inject a controller into a controller?

My application has a multi-tab order wizard. It has one Controller called OrderController. I decided I wanted to have one controller per tab, and for OrderController to manage all the tabs and ...
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
1answer
96 views

Angularjs Typescript Controller Inheritance and Dependency Injection

I am trying to create a set of Controller classes which are derived from a base class that have many dependencies. Every time I want to create a derived class I have to copy the base class constructor ...
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 ...
0
votes
2answers
46 views

Start/Stop/Resume all in one button with Angular Timer

Using the pre-built "Angular Timer" directives available here (scroll down to progress bar example), I'm trying to build a progress bar with a Start, Stop and Resume button all-in-one. Examples on ...
0
votes
1answer
103 views

AngularJS ng-bind-html 2way data binding

I have an AngularJS app where I got some data from a webservice and parse some HTML to the template with ng-bind-html ... but when I try to bind data inside the ng-bind-html - nothing happens .. ...
1
vote
1answer
41 views

AngularJS load remote JS controller provided by webservice

I have a AngularJS app, that depends on a webservice, I would like to load some more controllers into the app from a remote host, after the app is loaded. I don't know i this is possible? In my ...
1
vote
4answers
52 views

AngularJS: Declaring vs Not declaring controller

I'm following the AngularJS tutorial on its site, and at the moment my controller is as followed, and the page loads perfectly: var phonecatApp = angular.module('phonecatApp', []); ...
0
votes
1answer
46 views

ng-repeat, ng-click, directive, and controller interaction

I have this directive snippet: return { scope: {}, restrict: 'E', templateUrl: 'partials/order_table.html', controller: 'OrderController as x', link : ...
0
votes
1answer
18 views

Directives not loading in order when navigating between pages that reuse directives

I have a two separate pages that use the same controller. I'm using ui router states to change between pages. They contain the following directives which use templateUrl for templates in order: Page A ...
0
votes
2answers
52 views

Using object name when AngularJS variable is defined in $scope

Let's say we have an NameController in AngularJS. There you can define variables like this: this.name = 'Joe'; Or: $scope.name = 'Joe'; I always like to call all variables using the object ...
1
vote
1answer
68 views

How to test if the scope is populated after the broadcast and evaluating URL redirection process?

Updated : In this controller I am trying to test the user login process and it calls loginRequest method in WebService to send out user credentials as a login message. A loginreply message is received ...
0
votes
1answer
35 views

Modify elements based on data from ng-repeat

So i've just started learning Angular JS and i'm having troubles to do something that should be really simple but I can't figure out how to do it. Here's my problem... I have a Array of objects from ...
0
votes
1answer
45 views

AngularJS, ngResource, Service and multiple controllers. How to keep data synchronized?

I searched a lot about this, and although I found some similar problems, they are not exactly what I want. Imagine this kind of code: angular .module('foobar', ['ngResource']) ...
0
votes
3answers
77 views

Show/hide element AngularJS based on Controller boolean variable

I am trying to hide/show a portion of a form based on a Controller boolean variable. this is my html code: <div id="sheetform-container" ng-controller="SheetController as SheetCtrl"> <form ...
0
votes
0answers
65 views

Error defining AngularJS Controller

I am starting with AngularJS, creating my first App & Controller I get this error: Error: [ng:areq] ...
0
votes
1answer
44 views

Update directive variable from controller

New to AngularJS I have a simple directive, service and controller. I loop through a list of items from a database in the controller embedded in the directive to render a checkbox list of items. From ...
1
vote
2answers
63 views

opening a modal without using a button in angularJS which is accessible to all the controllers

<div class="modal-content"> <div class="modal-header"> <h3 class="modal-title">Standard message modal</h3> </div> <div class="modal-body"> ...
0
votes
1answer
48 views

Anguler js api url in loop

$http({method: 'GET', url: '/xxx/xxx/xas'}).success(function(data) { $scope.website = data.websites; }); $http({method: 'GET',url: ...
0
votes
1answer
61 views

How to delay execution of a controller (angularjs) till an external JS file loads?

I'm working on a Youtube API based project in which I've already bootstrapped angular. I'm encountering a problem when I need to call an external JS to load the iFrame API js file first and then allow ...
0
votes
1answer
50 views

Controlling multiple views in one controller in AngularJS

Following the MVC pattern, one controller should be able to handle multiple views in AngularJS. E.g. I have one view for showing all users and one for creating a new user. My $routeProvider ...
-2
votes
2answers
63 views

Call directive API method from 'parent' controller in AngularJS

I have a situation where I want to create custom component, which should be reusable and provide public API to change it's state. I am trying to achieve this by building component using directive and ...
1
vote
1answer
26 views

Angular controller called twice… how to know the amount of instantiations

is a controller instantiated a second time when I declare the controller in two different DIV's? So I just want to know if the controller will be loaded twice or not like this. Tanks in advance for ...
1
vote
1answer
24 views

Trouble getting size of an array in a js object inside controller

I want to get the size of some data I am retrieving in my controller - I have tried the following code; both utilizing a new Object.size function and attempted to get the length property directly ...
0
votes
1answer
28 views

Where is the controller placed using $routeProvider?

With ng-controller="myController" you know exactly what DOM element is associated with the controller, because it's put directly into your HTML: <div ng-controller="myController"> with ...
0
votes
2answers
38 views

Scope issue in $http success callback

I'm using PHP to get data into my factory, which shows correctly in the success callback function within the controller. However, even after assigning the returned data to $scope.customers, it's not ...