gpt4 book ai didi

javascript - 我需要 Angular/Ionic 应用程序方面的帮助

转载 作者:行者123 更新时间:2023-12-03 07:03:12 25 4
gpt4 key购买 nike

所以,我只是在学习如何使用 Angular,并且也在使用 Ionic。我正在尝试使用 Visual Studio 制作我的 Cordova 应用程序的首页。我已经在我的代码中发现了一堆错误,我已经修复了这些错误,但还必须有更多错误,因为它仍然无法正常工作。所有帮助将不胜感激。这是部分代码:

var app = angular.module('myApp', []);
app.controller('myCtrl', function ($scope) {

$scope.darkness = darkness;
darkness = "Darkness"

$scope.myFunction = function () {
$scope.text = text;
text = "Nothing but darkness and the pain that radiates through your very being."

}
});
<body>
<div ng-app="myApp" ng-controller="myCtrl">
<p> {{ darkness }} </p>
<p> {{ text }} </p>
<button ng-click="myFunction()">???</button>
</div>

<script type="text/javascript" src="cordova.js"></script>
<script type="text/javascript" src="scripts/platformOverrides.js"></script>
<script type="text/javascript" src="scripts/index.js"></script>
<script src="scripts/gamefunctions/chapterone.js"></script><script src="scripts/lib/ionic/js/ionic.bundle.js"></script>
</body>

最佳答案

首先添加AngularJS

 <script type="text/javascript" src="cordova.js"></script>
<script src="scripts/lib/ionic/js/ionic.bundle.js"></script>
<script type="text/javascript" src="scripts/platformOverrides.js"></script>
<script src="scripts/gamefunctions/chapterone.js"></script>
<script type="text/javascript" src="scripts/index.js"></script>

定义第一个然后使用它

var    darkness = "Darkness";
$scope.darkness = darkness;

var text = "Nothing but darkness and the pain that radiates through your very being.";
$scope.text = text;

关于javascript - 我需要 Angular/Ionic 应用程序方面的帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36945729/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com