Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 90579

In MVC architecture (Model-View-Controller), the object responsible for passing and receiving data to and from views, acting as a bridge between the "Model" and the "View".

2 votes
3 answers
11k views

AngularJS controller to fetch and display employee data from database

This is the code for an AngularJS controller that I've written: app.controller('employeeController', function (employeeService) { var Controller = this; Controller.employees = {}; Controller.fetchedEmployee … It feels like all the functions and variables have been 'injected' randomly in the controller; like someone randomly putting playing cards in a neatly shuffled deck or randomly placing books in a bookshelf …
cst1992's user avatar
  • 151
1 vote

AngularJS controller to fetch and display employee data from database

Reference from this AngularJS style guide from John Papa: https://github.com/johnpapa/angular-styleguide Controller can be replaced with vm, which stands for View-Model. … The controller can also be made a function declaration and getters can be used, eliminating the need to assign angular.module to a variable app. This is for the same reason as in the previous point. …
cst1992's user avatar
  • 151
0 votes

AngularJS controller to fetch and display employee data from database

Controller should start with a capital letter as it's a constructor. … Code: The main controller: (function(){ angular.module('myApp') .controller('EmployeeController', EmployeeController); function EmployeeController(employeeService, errorService) { …
cst1992's user avatar
  • 151