【发布时间】:2015-06-15 23:34:07
【问题描述】:
我有一个继承自 ng-view 元素的 Angular 视图。
在视图文件中,我有一个画布。代码由控制器控制。我想做的是调出一个舞台在画布上添加元素。
但是,当我运行 createJS.Stage 函数时,会创建一个舞台,其中所有内容都为 null 并且没有边界。
我猜元素没有绑定到舞台,但我不知道为什么
index.html
<ng-view style='height: 100%;'></ng-view>
template.html
<div class='middle' style="min-height:90%;height:90%">
<div class='col-lg-8'>
<canvas id="demoCanvas" class='col-lg-11' style='margin-top:10px'></canvas>
</div>
</div>
JS
app.controller('taskController',function($scope,$location,$routeParams,dataFactory){
var stage = new createjs.Stage("demoCanvas");
console.log(stage.getBounds());
//bounds turn up as null as well as style and any other function that I run
}
【问题讨论】:
标签: javascript angularjs easeljs createjs