The AngularJS ngController directive attaches a controller class to the view. This is a key aspect of how angular supports the principles behind the Model-View-Controller design pattern.
Questions tagged [ng-controller]
186 questions
1
vote
1 answer
Return list of properties using ng-repeat (AngularJS)
I am trying to convert a working JavaScript/Jquery feature to AngularJS (1.0) so I can add it to a fairly large AngularJS application. I am having some issues getting data to the view using ng-repeat and not sure where my issue is. I was reading…

SDH
- 393
- 3
- 18
1
vote
1 answer
ng-options disabled in array
I have a view that manages school's tests in a period (trimester or semester). Each semester can have many tests of type normal but only one of type examen.
I have made a script in jsFiddle that shows the behavior I am looking for…

Jorge
- 333
- 1
- 5
- 17
1
vote
3 answers
Get undefined when reading $scope variable
I'm trying to read the variable accessCode in my form in a Angular (1.6.8) function but I only get undefined.
The HTML
1
vote
1 answer
Error: [$controller:ctrlreg] The controller with the name 'quizController' is not registered
I'm getting Error:
[$controller:ctrlreg] The controller with the name 'quizController' is not registered.
quizController.js:
angular.module("quizApp",[])
.controller("quizController", function($scope) {
$scope.message = "Hello…

TDM
- 11
- 1
1
vote
1 answer
Data only displayed after refresh AngularJS
I'm using plain controller to make cart system and $ngcookies. Everything works but the only thing that My Data (.name) only displayed at cart after browser refresh/reload, to be honest main HTML and Cart.html in different controller/view…

Andre Ramadhan
- 427
- 2
- 14
1
vote
2 answers
$routeProvider is not able to access html template
I have added both the files of angular.min.js and angular-route.min.js but still not working
app.js code:
var myApp = angular.module('myApp',[
'ngRoute',
'artistControllers'
]);
myApp.config(['$routeProvider',…

Karan Tiwari
- 73
- 8
1
vote
0 answers
Using ng-include with controller as syntax
I need to change the "controller as" name to ctrl in "_restaurantdiv.html" since I am using this partial file in different places under different controllers. Currently I am doing so by writing ng-controller along with ng-include. But the problem…

PCK
- 1,254
- 6
- 20
- 37
1
vote
0 answers
Anglularjs passing value from Controller, State Resolve and Factory Service
Okay, I have three relevant files for my question/s..
App.js - app.config
In my app.config passing value in the resolve using $stateParams is possible and I attain it. But how about the value is from the controller? I need the provCode value to use…

Marksmanship
- 169
- 1
- 11
1
vote
0 answers
Can one module controller be injected into another module controller?
Want to confirm whether a controller from one module can be injected into another module? I know, we can inject the factory, services and etc from one module to another. But, can it be possible to access the stuff inside one controller into another…

undefined
- 31
- 1
- 5
1
vote
1 answer
sending data to another app modul (another page) using a dblclick function in angularjs
I have two pages in my angularjs application, I get some data from database to show in a table, then i doubleclick on a row and go to another page to show more details.
The problem consists on how to send data from the first page to the second one…

sansa
- 11
- 4
1
vote
1 answer
$watch in angularJS is not working as expected
In my controller I want to be notified when a variable value is changed. My requirement is when value of a variable will change a function will be invoked. So I am using $watch. My code is as follow.
var Canvas =…

KOUSIK MANDAL
- 2,002
- 1
- 21
- 46
1
vote
2 answers
AngularJs: how to get value by passing key without any label?
I am new to angular key,value concepts. Down below is my json object-> key,value.
key->String
value->object
{
"Value 3": {
"paymentRequestMethod": null,
"bankHolderName": "BANKHOLDER3",
"routingNumber": "278723",
…

vignesh selvarathinam
- 129
- 2
- 13
1
vote
2 answers
How to bind different scopes from one controller to the one?
I have a controller that I use in two places: in a ng-view and in a ng-include. These places are not child or parent to each other, but I want to some changes made in the ng-view affect to ng-include as well. How can I do that?
Here is plunker with…

through.a.haze
- 516
- 1
- 6
- 15
1
vote
2 answers
"Direct nesting" of ng-controllers. Is this normal?
This might be late to the game with Angular 2 being the new kid on the block, but I recently came across this in a corner of a project. I've not worked on many Angular apps of this scale (with regards to team members contributing), and I'd like to…

Rohan Büchner
- 5,333
- 4
- 62
- 106
1
vote
1 answer
AngularJS Child controller data not loading on UI while using $emit to refresh Parent data
I am using AngularJS 1.5 and using ‘$emit’ to send an event to parent controller to refresh parent controller data. On ‘$On’ I have written the logic to refresh the parent controller data.
Now, Parent controller data is being updated but after that…

Banketeshvar Narayan
- 3,799
- 4
- 38
- 46