我在移动设备上使用温泉,我使用,并将pushPage放入一个页面,例如page1.html,并且在page1.html上有一个ons-list,我将内容添加到它,它运行良好,但是当我在page1.html上添加按钮时,该按钮是将js pushpage调用到同一页面(page1.html),但它不起作用,无法附加内容,为什么?以及如何解决它,请帮忙,非常感谢你。 代码流程: page1.html
<!doctype html>
<html lang="zh-cn" ng-app="app">
<head>
<meta charset="utf-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<title>cs</title>
<style>
.sp-button {
width: 100%;
margin: 0 auto;
}
</style>
</head>
<body>
<ons-page ng-controller="todo">
<div class="navigation-bar">
<div class="navigation-bar__left">
<ons-back-button>back</ons-back-button>
</div>
<div class="navigation-bar__center">
title
</div>
<div class="navigation-bar__right">
<ons-button id="cs" ng-click="init();" class="button" style="cursor: pointer;width:50px;font-size:small">refesh</ons-button>
</div>
</div>
<ons-list id="ToDoDetail">
</ons-list>
<div id="kk">
</div>
<on-list>
<div>aabb</div>
</on-list>
</ons-page>
</body>
</html>
JS:
(function () {
var app = angular.module('app', ['onsen.directives']);
})();
app.controller('todo', function ($scope, $timeout, $http, $location) {
var listItem = '<ons-list-item>aabb</ons-list-item>';
$('#ToDoDetail').append(listItem);
$('#kk').append('ffff');
$scope.init = function () {
appNavigation.pushPage('main/sub/page1.html?cs=55', { animation: 'slide' });
};
};