2016-10-24 5 views
0

Ich möchte ein Formular anmelden. Aber wenn ich das Ergebnis im Browser sehen will, passiert nichts. Wenn ich die Konsole öffne, lautet die Fehlermeldung:Uncaught SyntaxError: Unerwartete Token in Ionic

Ich weiß nicht, was mit dem Code falsch ist. Kann mir bitte jemand helfen? Ich bin neu in ionischer

Index:

<!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> 
    <script src="js/controllers.js"></script> 
    <script src="js/services.js"></script> 
    <script src="js/constant.js"></script> 
    </head> 
    <body ng-app="starter" ng-controller="AppCtrl"> 
    <ui-view></ui-view> 
    </body> 
</html> 

Controller:

angular.module('starter') 

.controller('AppCtrl', function($scope, $state, $ionicPopup, AuthService, AUTH_EVENTS){ 

}); 

Dienstleistungen:

angular.module('starter'); 

.service('AuthService', function($q, $http, API_ENDPOINT) { 
    return { 

    }; 
}) 

.factory('AuthInterceptor', function($rootScope, $q, AUTH_EVENTS){ 
    return { 

    }; 
}) 

.config(function ($httpProvider){ 
    $httpProvider.interceptors.push('AuthInterceptor'); 
}); 

app.js:

angular.module('starter', ['ionic']) 

.run(function($ionicPlatform) { 
    $ionicPlatform.ready(function() { 
    if(window.cordova && window.cordova.plugins.Keyboard) { 
     // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard 
     // for form inputs) 
     cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true); 

    } 
    if(window.StatusBar) { 
     StatusBar.styleDefault(); 
    } 
    }); 
}) 

.config(function($stateProvider, $urlRouterProvider){ 
    $stateProvider 
    .state('outside',{ 
    url : '/outside', 
    abstract : true, 
    templateUrl : 'templates/outside.html' 
    }) 
    .state('outside.login',{ 
    url : '/login', 
    templateUrl : 'templates/login.html', 
    controller : 'LoginCtrl' 
    }) 

    $urlRouterProvider.otherwise('/outside/login') 
}) 

Formular Login:

<ion-view view-title="Please Sign in"> 
    <ion-content class="padding"> 
     <div class="list"> 
      <label class="item item-input"> 
       <input type="text" placeholder="Name" ng-model="user.name"> 
      </label> 
      <label class="item item-input"> 
       <input type="password" placeholder="Password" ng-model="user.password"> 
      </label> 
     </div> 
     <button class="button button-full button-balanced" ng-click="login()">Login</button> 
     <button class="button button-full button-clear button-positive" ui-sref="outside.register">Register Now!</button> 
    </ion-content> 
</ion-view> 
+1

entfernen; aus angular.module ("Starter"); – Vanojx1

Antwort

0

In Ihren Diensten entfernen Sie die; in der ersten Zeile.

angular.module ('starter'); < --- Dieser

Verwandte Themen