私は angularjs を初めて使用し、ディレクティブを作成しようとしていますが、このエラーを回避できません。
Error: Unknown provider: $scopeProvider <- $scope <- someDirectiveDirective createInjector/providerInjector<@http://localhost:4242/js/lib/angular/angular.js:2734 getService@http://localhost:4242/js/lib/angular/angular.js:2862 createInjector/instanceCache.$injector<@http://localhost:4242/js/lib/angular/angular.js:2739 getService@http://localhost:4242/js/lib/angular/angular.js:2862 ... ... ...
次のように角度アプリを作成します。
var app = angular.module(
"myApp",
...
次に、別のファイルでディレクティブを作成してみます。
app.directive('someDirective', function($http, $scope, $element, $attrs) {
return {
restrict: "A",
次に、ディレクティブを使用します。
私は本当に愚かなことをしていると確信していますが、私にはわかりません。