javascript - asp.net mvc angularjs controller throwing error on registration -


i have simple view:

@{     viewbag.title = "arbitrary title";     layout = "~/views/shared/_layout.cshtml"; }  <div ng-controller="mycontroller myctrl">     <div id="grid" kendo-grid k-options="myctrl.options"></div> </div> 

with accompanied controller:

(function () {     "use strict";       /***debugger throws exception here***/      angular.module("myapp").controller("mycontroller", mycontroller);       mycontroller.$inject = ['$scope'];       function mycontroller($scope) {           //for brevity      } })(); 

the console throws exception:

  • error: [ng:areq] argument 'mycontroller' not function, got undefined
  • http://errors.angularjs.org/1.4.0/ng/...

i'm new angular, have learned, looks i'm not registering controller correctly? other controllers in project i'm working on registered same way, i'm bit lost.

the _layout.cshtml shared view has ng-app="myapp" set well.


Comments

Popular posts from this blog

java - Static nested class instance -

c# - Bluetooth LE CanUpdate Characteristic property -

JavaScript - Replace variable from string in all occurrences -