0

我希望这不是太琐碎,但我有一个我正在构建的科尔多瓦应用程序。我以前使用过cordova并使用过温泉,我试图尽可能地反映我之前所做的事情,但我没有从温泉中得到任何效果。这是索引页面:

<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License.  You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 KIND, either express or implied.  See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
    <meta charset="utf-8" />
    <meta name="format-detection" content="telephone=no" />
    <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="msapplication-tap-highlight" content="no" />

    <!--<link rel="stylesheet" src="http://code.jquery.com/jquery-1.9.1.css"></link>-->
    <link rel="stylesheet" href="lib/onsen/css/onsenui.css">  
    <link rel="stylesheet" href="lib/onsen/css/topcoat-mobile-onsen-green.css">
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script src="http://www.parsecdn.com/js/parse-1.2.19.min.js"></script>
    <script src="lib/onsen/js/angular/angular.js"></script>    
    <script src="lib/onsen/js/onsenui.js"></script> 

    <title>Top 100</title>
</head>
<body>
    <ons-screen>
        <ons-navigator title="List of Places">
            <div data-role="page" id="places">
                <div data-role="content">
                </div>
            </div>
        </ons-navigator>
    </ons-screen>

    <script type="text/javascript" src="cordova.js"></script>
    <script type="text/javascript" src="js/index.js"></script>
    <script type="text/javascript" src="js/app.js"></script>
</body>
</html>

我现在在正文中所做的只是使用 JavaScript 从解析中加载字符串列表。这里有什么可能导致温泉标签什么都不做吗?

4

2 回答 2

0

ng-app缺少,不确定是否是故意的(用于手动引导)?

<html ng-app="myApp">
于 2014-08-08T20:03:33.817 回答
0

通过更仔细地查看我的旧项目,我发现了这个问题。问题是在 app.js 我忘了添加这段代码

(function(){
    'use strict';
    angular.module('myApp', ['onsen.directives']);
})();

所以,@runTarm,你在一定程度上是对的。我确实需要 ng-app 标签,还需要激活温泉的代码。

于 2014-08-11T17:27:26.450 回答