Injection error in angularjs?

there is nothing wrong with the module name and the controller name. Why did you report an error? I tried for a long time but failed to solve it. There is a rookie at the front end. Please give me a lot of advice.

as shown in the figure, the page reports an error like this:
clipboard.png

HTML:
clipboard.png

JS:
clipboard.png

HTML source code:

<!DOCTYPE html>
<html lang="en" ng-app="MyModule">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <script src="js/angular1.5.0.min.js"></script>
    <script src="js/scopeBind.js"></script>
</head>
<body>
<div ng-controller="MyCtrl">
    <drink flavor="{{ctrlFlavor}}"></drink>
</div>
</body>
</html>

JS source code:

var MyModule = angular.module("MyModule", []);
MyModule.controller("MyCtrl", ["scope",
    function ($scope) {
        $scope.ctrlFlavor = "";
    }
])
MyModule.directive("drink", function () {
    return {
        restrict: "AE",
        template: "<div>{{flavor}}</div>",
        link: function (scope, element, attrs) {
            scope.flavor = attrs.flavor;
        }
    }
})
Feb.28,2021

spelling error, code is fine

MyModule.controller("MyCtrl", ["$scope",
    function ($scope) {
        $scope.ctrlFlavor = "";
    }
])

Controller dependency injection is wrong. You write scope, and angular contains $scope, so you can't find this service and report an error.


MyModule.controller ('MyCtrl', function ($scope) {

        $scope.ctrlFlavor = "";

});

The injections of

angularjs1 are all $scope,. Only if you want to pass the current scope to another method, you can change it to scope according to the corresponding arguments and parameters

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b2b92d-2aff0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b2b92d-2aff0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?