Aviator
Aviator

Reputation: 613

Argument '' is not a function, got undefined in Kendo ( AngularJS )

I want to make a Kendo grid with 4 tabstrips, 4 children grids, 5 controllers, first is parent, others are children. Here is a part of code, with one parent and one child controller. Problem is that all the time I got an error "Argument '' is not a function, got undefined" Where should I define it? Everything is stored locally so the preview is not possible

Upvotes: 0

Views: 375

Answers (1)

lintmouse
lintmouse

Reputation: 5119

Check this out:

http://fdietz.github.io/recipes-with-angular-js/controllers/sharing-models-between-nested-controllers.html

You don't nest the controllers in your javascript. This is from that link:

var app = angular.module("MyApp", []);

app.controller("MyCtrl", function($scope) {
  $scope.name = "Peter";
  $scope.user = {
    name: "Parker"
  };
});

app.controller("MyNestedCtrl", function($scope) {
});

Instead, you nest the controllers in your markup. I don't see where you are binding the controllers in your markup, btw.

<body ng-app="MyApp">
  <div ng-controller="MyCtrl">
    <label>Primitive</label>
    <input type="text" ng-model="name">

    <label>Object</label>
    <input type="text" ng-model="user.name">

    <div class="nested" ng-controller="MyNestedCtrl">
      <label>Primitive</label>
      <input type="text" ng-model="name">

      <label>Primitive with explicit $parent reference</label>
      <input type="text" ng-model="$parent.name">

      <label>Object</label>
      <input type="text" ng-model="user.name">
    </div>
  </div>
</body>

This is all from that link I provided.

Upvotes: 1

Related Questions