gpt4 book ai didi

angularjs - 由于 : Error: [$injector:nomod],无法实例化模块启动

转载 作者:可可西里 更新时间:2023-11-01 13:26:41 26 4
gpt4 key购买 nike

app.js:-

var app = angular.module('start', ['ionic']);
app.run(function($ionicPlatform) {
$ionicPlatform.ready(function() {
if(window.cordova && window.cordova.plugins.Keyboard) {
cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
cordova.plugins.Keyboard.disableScroll(true);
}
if(window.StatusBar) {
StatusBar.styleDefault();
}
});
});
app.controller('sign_up', function($scope, $http){
$scope.check_cred = function(){
document.getElementById('message').textContent="";
var request = $http({
method:"post",
url: "http://10.0.128.152/ionic/login.php",
data:{
email = $scope.email,
pass = $scope.pass
},
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
});
request.success(function(data){
document.getElementById("message").textContent = "Login successful with "+data;
});
}
});

index.html

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>

<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">

<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->

<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>

<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>

<!-- your app's js -->
<script src="js/app.js"></script>
</head>
<body ng-app="start" ng-controller="sign_up">

<ion-pane>
<ion-header-bar class="bar-header bar-dark">
<h1 class="title">Lazywyre</h1>
</ion-header-bar>
<ion-content class="padding">
<div class="list">
<label class="item item-input">
<input type="text" ng-model="email" placeholder="Email">
</label>
<label class="item item-input">
<input type="password" ng-model="pass" placeholder="Password">
</label>
<button ng-click="check_cred()" class="button button-full button-positive">
Submit
</button>
</div>
<span id="message"></span>
</ion-content>
</ion-pane>
</body>
</html>

我知道这是常见错误,但我已经检查了代码并且看起来没问题。我找不到错误。我到处搜索它,发现语法是正确的。我是 Angular 的新手,所以如果有任何愚蠢的错误请忽略并帮助我。

最佳答案

由于这一行,您收到此错误:

data:{
email = $scope.email,
pass = $scope.pass
},

应该是:

data:{
email: $scope.email,
pass: $scope.pass
},

关于angularjs - 由于 : Error: [$injector:nomod],无法实例化模块启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36977226/

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