The AngularJS controller 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
1answer
32 views

Pass $scope data from controller to view

I want to display $scope.predicate and $scope.reverse values into my view(in the <p> tag ). It seems that using {{ }} expression is not working. app.js: var app = angular.module('testApp', ...
11
votes
2answers
249 views

How to do autocomplete dropdown as a grid in angularJS?

Here I created sample for autocomplete, which is working fine and I need to do some modification on this.currently it works like this but what I exactly need is I need to show the dropdown as grid ...
0
votes
1answer
25 views

How to get Values from Other AngularJs Controller $scope variable

I'm having two controllers namely AController and BController. I need to get the value of Controller AController's $scope.myName to the Controller BController's $scope.myName. Note: Here I'm not ...
1
vote
2answers
26 views

Unable to call parent controller method from directive

I've seen the many, many, many, many questions on this problem but for some reason I still can't bind ng-click in my directive to a method on the parent controller. I'm pretty sure I've got my scope ...
0
votes
1answer
17 views

Change child scope using broadcast from app.run

I have an angular app with the name DemoProject. I have an app.run controller and one child controller JS var app = angular.module("DemoProject", ['ngRoute', 'ngAnimate', 'ngMessages', ...
0
votes
0answers
9 views

Change Values for an angularJS child Controller property in app.run

I having a angular module app in the name of the ng-app DemoProject. Now I'm creating app.run controller and one child controller My AngularJS Script var app = angular.module("DemoProject", ...
0
votes
2answers
34 views

How to change Selected Tab inside controller in angularjs?

Here I created Sample For Tabs. What I exactly need is inside sample controller manually I need to set selected tab based on config parameter. At load time I need to set manually the tab to be ...
0
votes
4answers
47 views

console.log for $scope in angualr js

Why I'm not able to console output $scope values ? I'm trying to extract user assigned values from the pages and retrieve in controller. Eventually i would like to pass this to service so multiple ...
216
votes
13answers
159k views

AngularJS : How can I pass variables between controllers?

I have two Angular controllers: function Ctrl1($scope) { $scope.prop1 = "First"; } function Ctrl2($scope) { $scope.prop2 = "Second"; $scope.both = Ctrl1.prop1 + $scope.prop2; //This is ...
0
votes
1answer
20 views

How to do dynamic Helpcontext with anchor scroll in angularjs?

Here I created a sample for a dynamic Help Context. Based on the page it will load dynamic help data which is working fine. In local $anchorScroll is also working fine. What I need exactly is while ...
1
vote
1answer
45 views

Scope Variable undefined in angularjs typescript controller class of directive

I have created wrapper directive over ag grid as below function MyDirective(): ng.IDirective { var directive = <ng.IDirective>{ restrict: "E", template: '<div ...
1
vote
2answers
26 views

POSTing item from ng-repeat

I have a simple ng-repeat, that displays a list of addresses. Next to each address is a button, when clicked, i want to perform a HTTP:POST. I know know how to perform a REST call, but im struggling ...
2
votes
2answers
1k views

Customize AngularJS Bootstrap Tooltip

How do I add custom placements/animations to an AngularJS/Bootstrap tooltip? I can do: myApp.controller('TooltipCtrl', function ($scope) { $scope.htmlTooltip = 'Here is a tooltip!'; }); And it ...
-1
votes
0answers
20 views

How to find my Angular bugs? [duplicate]

I am using the framework Angular.js. My problem is, that it is hard to find a bug in my own code. Always when I do something wrong (no matter how small the problem is) the whole code doesnt work ...
13
votes
3answers
10k 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 ...
3
votes
3answers
42 views

Difference in controller declaration in AngularJS

I have seen controller being declared in two ways as below. But what diff does this make? appmodule.controller('Actrl',['$scope',function($scope) {}]); appmodule.controller('Actrl',function($scope) ...
1
vote
1answer
19 views

Argument 'indexController' is not a function, got undefined

This has been asked before but it didn't answer my question. I am pretty new to angular and I am just putting things together at the moment. I am trying to get my factory to work inside my controller. ...
1
vote
1answer
39 views

Angularjs controller function vs directive function

Lately I've been building some modules and in some of them I only used controllers (controller is set within an existing directive I already need to use to load template) to have this comunnication ...
0
votes
0answers
14 views

create multiple jqxwindow with angularjs

I'm beginner in AngularJS and I want to create multiple jqxwindow with AngularJS. How can I do it with Angularjs-directive or AngularJS-controller?
0
votes
4answers
805 views

Angularjs undefined variable in controller

I have a problem in controller with the properties of object. My factory return one object with another object and one function. I can call the function but i can't access in another object ...
1
vote
2answers
300 views

Angular bind service property to a controller scope

I have 2 controllers using the same service, the first controller change the value of a property on the service, I need the second controller to know the property has changed to set the new value in ...
1
vote
3answers
45 views

How to keep track of current user in angularJS controllers?

factory / service: angular.module('phoenix-template') .factory('User', ['$http', function($http){ function current(){ ...
0
votes
1answer
28 views

Angularjs directive template = $scope.(some variable from another controller)

This is part of my AngularJS application .controller('Littlebear',function($scope) { $scope.spread='<h1>this is the</h1> Littlebear spread.'+ '<img ...
0
votes
1answer
18 views

Sending received Rest data in service file to controller angularjs

I am new to angular js and I have a problem sending the received data from my service file to controller, which ultimately binds to my html. Can someone please help me resolve this problem. Thank you. ...
2
votes
2answers
23 views

Error: [ng:areq] customerController not a function got undefined

I am beginner to angularjs and I am writing a simple application to get started with it. I keep getting this error Error: [ng:areq] customerController not a function got undefined I have tried to ...
0
votes
1answer
43 views

is it Possible (partial class) concept for controller in angularjs?

Is there any way to do code grouping using partials in angularjs? Reason --- I have a controller which contains too much code. This controller contains the code For several Methods and a lot of ...
0
votes
4answers
60 views

Why post method not working in angularjs in this example?

Here I created sample for read and update json file. Reading the json file is working properly but I tried to update the json file that it show's Failed to load resource: the server responded with a ...
34
votes
13answers
55k views

Error: [ng:areq] from angular controller

This is a long shot, but has anyone seen this error before? I am trying to add 'Transporters' using express, angular and mongoDB. I get this error whenever I access a page ruled by the transporters ...
1
vote
2answers
180 views

How to update an angular directive with async data

I have a controller which gets json data called content.json. When I render the UI, I can't know if the json is available yet. The controller gets the json data asap when the app loads, it is an array ...
0
votes
0answers
24 views

How to create a constructor for controller in angularjs?

Am learning angularjs. I want to now is it possible to create constructor in angular? if it is yes, how to create constructor for controller? can any one help me on this thanks,
5
votes
3answers
6k views

Angularjs Uncaught Error: [$injector:modulerr]

I am learning Angular.js and I am not able to figure out whats wrong with this simple code. It seems to look fine but giving me following error. **Error**: Uncaught Error: [$injector:modulerr] ...
3
votes
1answer
63 views

How to load dynamic Tabs in ngDialog box in angularjs?

Dynamic Tab Sample File Link -- Not Working Static Tab Sample File Link -- Working In NgDialog Tabs Not Showing In above link I added the sample file for ngDialog model with tabs. In index ...
0
votes
1answer
21 views

How to implement message before redirect in angularjs using ngdialog?

How to create unsave change in angularjs using ngdialog. Eg: currently we are in page1 some fields we are edited. directly we going to page2 or somewhere that time ngdialog need to popup and ask if ...
1
vote
1answer
59 views

Angular JS: update controller when data change in second controller

what i m doing: simple html file shows first page , in this page i have one title and button, initially i set $scope.index = 0. so, we set first position of array. when we click on next button it ...
0
votes
1answer
29 views

AngularJS: should I choose what to print in the view or the controller?

I have a user info view where I have a table with some user data, which I get asynchronously from the backend. I don't want to print every field of this object. What's the better practice, to pick ...
0
votes
1answer
51 views

Able to access `$scope` and `this` using controller as syntax. Why?

I'm building an Angular controller using controller as syntax: <body ng-controller="ctrl as myCtrl"> <p>accessed via scope resolution: {{ foo }} </p> <p>accessed via ...
0
votes
1answer
23 views

Angular controller functions are both constructors and a decorators?

If one writes a controller as ctrl for the following code: function Controller($scope) { $scope.abc = "123"; } angularApp.controller("controller", Controller); Does the pseudo code below ...
0
votes
1answer
41 views

How can I pass an data from factory to my controller in angularjs?

I'm trying to move all the business logic from my controller to the factory, but I'm having some trouble passing fields data. factory.js app.factory("Quote", function ($resource) { // TODO: this ...
0
votes
2answers
61 views

Ng-click not firing in angularjs?

Here I created sample angular program for button click. but its not firing may i know where i did mistake? can any one help me on this.. thanks var myApp = angular.module('myApp', []); ...
0
votes
0answers
25 views

AngularJS & Modules - Can access controller properties, but can't fire events

I'm using browserify to include my controllers etc. as modules: var app = angular.module('app', [...]) var LoginCtrl = require('./controllers/Login'); Where I define said controller as follows: ...
12
votes
3answers
6k 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 ...
1
vote
2answers
40 views

How to do base class concept for CRUD in angularjs?

Currently Am doing student project in angularJS. In that I need to use base class concept for CRUD operation.. I need to create one base class in that class contain Create, read, update and delete ...
0
votes
1answer
33 views

How to declare and use modules, controllers, services and bootstrap manually in Angular?

i'm trying to build an AngularJS app that has one Controller, one Service and that Bootstraps manually (no ng-app). The problem is that I keep having an error : Argument 'AppController' is not a ...
5
votes
2answers
993 views

angularjs: preventing route changes

I've tried doing the following in my controller: $scope.$on("$routeChangeStart", function (event, next, current) { if (!confirm('are you sure ?')) { event.preventDefault(); ...
-1
votes
1answer
70 views

Angularjs controller embed in a function

How about embedding angularjs controller in a function. So that we can initiate whenever we want. fucntion execute() { angular.controller('ProductsPageController', ['$scope', '$http', ...
0
votes
1answer
32 views

How to Change Post Variable Value in a AngularJS Controller?

I'm having two buttons, each button has ng-click event, the click event calls one method, the method has one argument. I wish to pass the value of the argument to the Service Side via HTTP POST from ...
0
votes
1answer
43 views

AngularJS Controllers not showing the result

When user enter texts on textbox {{student.fullName()}} should be updated. But this is not working. Any help? Sample Applications <div ng-app = "mainApp" ng-controller = "studentController"> ...
1
vote
2answers
2k 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 ...
2
votes
4answers
38 views

How to Wire Up Adjacent Isolated Scopes in AngularJS

I am still learning AngularJS, and I have a bit of a conceptual question: What is the best way to wire up two adjacent, isolated scopes in AngularJS? By 'adjacent' scopes, I mean on the same level ...
0
votes
0answers
38 views

Why won't my view get updated in Angular Js?

I'm trying to do some error handling for my web app ; more specifically, I want to display an error message whenever the server fails to deliver a message to the client. I have a controller that is ...