Kevin Meredith Kevin Meredith - 10 months ago 36
AngularJS Question

Error: Argument is not a function, got undefined

Using AngularJS with Scala Play, I'm getting this error.

Error: Argument 'MainCtrl' is not a function, got undefined

I'm trying to create a table consisting of the days of the week.

Please take a look at my code. I had checked the name of the Controller, but that seems correct. Note: Code used from this SO answer


@(message: String)

@main("inTime") {

<!doctype html>
<html lang="en" ng-app>
<link rel="stylesheet" media="screen" href=""stylesheets/main.css")">
<div ng-controller="MainCtrl">
<table border="1">
<tbody ng-repeat='(what,items) in data'>
<tr ng-repeat='item in items'>
<td ngm-if="$first" rowspan="{{items.length}}">{{what}}</td>


(function() {
angular.module('[myApp]', []).controller('MainCtrl', function($scope) {
$ = {
Colors: ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]


Remove the [] from the name ([myApp]) of module

angular.module('myApp', [])

And add ng-app="myApp" to the html and it should work.