admin管理员组文章数量:1288075
This code is not working:
<td><img src="{{$rootScope.s3BucketUrl}}"/></td>
and this is where it's defined:
var appCtrl = app.controller('AppCtrl', function($scope, $resource, $location, $route, sharedProperties, $q, $rootScope){
defer = $q.defer();
//$rootScope.s3BucketUrl = '/';//ment below one when live
$rootScope.s3BucketUrl = '/';
//code omitted
});
AppCtrl is bound first on body tag.
Could anybody please suggest how do I print $rootScope variable?
This code is not working:
<td><img src="{{$rootScope.s3BucketUrl}}"/></td>
and this is where it's defined:
var appCtrl = app.controller('AppCtrl', function($scope, $resource, $location, $route, sharedProperties, $q, $rootScope){
defer = $q.defer();
//$rootScope.s3BucketUrl = 'http://lynd.s3.amazonaws./';//ment below one when live
$rootScope.s3BucketUrl = 'http://lynd-test.s3.amazonaws./';
//code omitted
});
AppCtrl is bound first on body tag.
Could anybody please suggest how do I print $rootScope variable?
Share Improve this question asked Jul 20, 2013 at 6:42 JackJack 7,55722 gold badges66 silver badges107 bronze badges1 Answer
Reset to default 10Just use {{s3BucketUrl}}
and you would get the value.
Your current scope is a child scope of rootscope and hence you can always access the elements of rootscope.
This wiki is highly remended
本文标签: javascriptHow do I print rootScope variableStack Overflow
版权声明:本文标题:javascript - How do I print $rootScope variable? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741333515a2372903.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论