2

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:

enter image description here

Insight
  • 45
  • 6
  • possible duplicate of [Error: \[ng:areq\] from angular controller](http://stackoverflow.com/questions/21673404/error-ngareq-from-angular-controller) –  May 22 '15 at 03:19
  • 1
    maybe its not loading the dependency ['btford.modal'] ? check to ensure that the referenced external .js dependency file is in your index.html, for example. – Shehryar Abbasi May 22 '15 at 03:20
  • @ShehryarAbbasi i've deleted this controller and dependency and leave only buketCtrl, error isn't disappears... – Insight May 22 '15 at 03:37
  • `app.controller('modalCtrl', function (myModal)` doesn't need `$scope`? so what happens if you empty the contents of all Controllers and Factory and remove all dependencies from the functions too? same error? – Shehryar Abbasi May 22 '15 at 03:39
  • Sry. Question solved. In this file above was declared . I didn't see. Other developer added this before me :) – Insight May 22 '15 at 03:47

1 Answers1

0

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

Insight
  • 45
  • 6