Createjs 和 Angularjs:无法读取未定义的 属性 'Stage'

Createjs and Angularjs: Cannot read property 'Stage' of undefined

嗨,我想将 Createjs 与 Angularjs 连接起来,我的控制器中有这段代码

var stage,padel,createjs;
    $scope.load = function () {
        init();
    }
    function init() {
        console.log('idsaf');
        stage = new createjs.Stage(document.getElementById('canvas'));
        canvas = document.getElementById('canvas');
        //aby grafika była ładna w canvasie
        canvas.width = window.innerWidth;
        canvas.height = window.innerHeight;
        createjs.Ticker.addEventListener("tick", tick);
        createjs.Ticker.setFPS(60);
        startGame();
    }

可见 html:

<script src="https://code.createjs.com/createjs-2015.11.26.min.js"></script>
    <script src="https://code.createjs.com/easeljs-0.8.2.min.js"></script>
    <script src="https://code.createjs.com/preloadjs-0.6.2.min.js"></script>
    <script src="https://code.createjs.com/tweenjs-0.6.2.min.js"></script>

<div class="wrapper" ng-init="load()">
        <canvas id="canvas"></canvas>
    </div>

当我 运行 时,控制台出现错误:

Cannot read property 'Stage' of undefined

如何解决这个问题,我在上面坐了 2 个小时

您在第 7 行(以及第 12 和 13 行)与您在第一行中声明的变量 createjs 存在命名冲突! 您应该将其从第一行删除或重命名!