When executing the code, the google developer tool reported the error The controller with the name 'my-injectorCtrl' is not registered. If I want to use inferential injection, what is wrong with this writing. I'm a newbie and I really can't figure out what I'm doing wrong. I hope you can give me some advice. I'd be very grateful!
<p ng-app>
<p ng-controller="my-injectorCtrl">
<span>{{TestInjector1}}</span>
</p>
</p>
var myInjectorModule = angular.module("MyInjectorModule",[]);
var myInjectorCtrl = function($scope){
$scope.TestInjector1 = "Hello Injector";
}
myInjectorModule.controller("myInjectorCtrl",myInjectorCtrl);
Just change it to the following
HTML file content:
JS file content: