Onsen UI标签没有做任何事情

时间:2014-08-08 17:54:35

标签: jquery angularjs cordova parse-platform onsen-ui

我希望这不是太微不足道,但我有一个我正在构建的cordova应用程序。我之前使用过cordova并使用过onsen,我试图尽可能地反映我之前做过的事情,但是我没有从温泉中获得任何效果。这是索引页面:

<!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解析加载一个字符串列表。这里有什么可能导致温泉标签什么都不做?

2 个答案:

答案 0 :(得分:0)

ng-app丢失了,不确定是否是故意的(手动引导)?

<html ng-app="myApp">

答案 1 :(得分:0)

我通过仔细审查我的旧项目来找出问题所在。问题是在app.js中我忘记添加此代码

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

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