这个错误是什么?此功能未在锁定列表

时间:2015-09-12 12:40:12

标签: angularjs onsen-ui monaca

这是错误信息。

Error: This function is not registered in the lock list.
    at Object.window.DoorLock.DoorLock._unlock (loader.js:1450)
    at window.DoorLock.DoorLock.lock.unlock (loader.js:1450)
    at Scope.parent.$get.Scope.$broadcast (loader.js:1444)

...

index.html

<!DOCTYPE HTML>
<html ng-csp>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <script src="components/loader.js"></script>
    <script src="js/winstore-jscompat.js"></script>
    <link rel="stylesshet" href="components/monaca-onsenui/js/angular/angular-csp.css">
    <link rel="stylesheet" href="components/loader.css">
    <link rel="stylesheet" href="css/style.css">
    <script src = "./js/prog.js" ></script>
</head>
<body ng-app = "magic_land" >
    <ons-navigator var="captain" page="list.html">
    </ons-navigator> 
</body>
</html>

...

list.html

<div >

  <ons-toolbar>
    <div class = "center">All todoz</div>
  </ons-toolbar>

  <ons-list>
    <ons-list-item>Apple</ons-list-item> 
    <ons-list-item>Banana</ons-list-item> 
    <ons-list-item>Carrot</ons-list-item> 

  </ons-list>

  <p> {{5+5}}  </p>

</div>

...

prog.js


        var magic_land = ons.bootstrap('magic_land', ['onsen']);

这个错误来自哪里?

1 个答案:

答案 0 :(得分:0)

<body ng-app="magic_land" ng-controller = "magic_action">
    <ons-navigator var="captain" page="list.html"   >
    </ons-navigator> 
</body>

<body >
    <ons-navigator var="captain" page="list.html" ng-app="magic_land" ng-controller = "magic_action"  >
    </ons-navigator> 
</body>

现在错误消失了!

我知道,这段代码与问题不同,但这是一个很难的错误,所以我不得不交换和重新排列我的代码以找到错误的来源。祝你好运!