简体   繁体   中英

AngularJS undefined controller

I've created angular module and 2 controllers:

var app = angular.module('buketApp', ['btford.modal']);

app.factory('myModal', function (btfModal) {
  return btfModal({
    controller: 'modalCtrl',
    controllerAs: 'modal',
    templateUrl: '/tpls/content/buket_modal.html'
  });
});

app.controller('modalCtrl', function (myModal) {
  this.closeMe = myModal.deactivate;
});

app.controller('buketCtrl', function ($scope, myModal) {
  this.showModal = myModal.activate;
});

Then declare it in html:

<div ng-app="buketApp" class="container" ng-controller="buketCtrl">

In console Chrome shows:

在此处输入图片说明

Question solved. In this file above was declared . I didn't see. Other developer added this before me :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM