AngularJS開発者ガイドでは、コンソールに$ scopeと入力してスコープを調べることができます。
To examine the scope in the debugger:
1.Right click on the element of interest in your browser and select 'inspect element'. You should see the browser debugger with the element you clicked on highlighted.
2.The debugger allows you to access the currently selected element in the console as $0 variable.
3.To retrieve the associated scope in console execute: angular.element($0).scope() or just type $scope
しかし、私は、コンソール上で$スコープを入力してよ、それはここで
Uncaught ReferenceError: $scope is not defined at :1:1
は参照用linkであると言います。
app.jsはので、ここで同じエラーが来てされているCodePenあるこの
var app=angular.module("app",[]);
app.controller("ctrl",['$scope','demoservice',function($scope,demoservice){
console.log(demoservice);
$scope.ser=demoservice;
}]);
app.service("demoservice",[function(){
this.name="Himanshu";
}]);
誰かがコードを求めているように見えます。
downvoteにはあまり公平ではありません。これは文字通り文章で – Phil
と書かれていますが、実行中で$スコープがメモリ内にあるときにブレークポイントを調べると、$ scopeがラップされているので、$ scopeにアクセスできるコントローラまたは関数の中にブレークポイントがありますコンソール内で共通変数としてグローバルではない内部コントローラ –
彼らが何をしようとしているかを示していない限り、それは公正です。おそらく、彼らはちょうど 'console.log($ scope);'($ scopeは__1:1__で定義されていません)という1行のjsファイルを作成しましたか?ユーザーが自分のコードを表示すると、私の投票を元に戻すかもしれません。 –