错误:在Android设备中以调试模式运行时,出现[$ compile:tpload]

时间:2019-05-02 14:19:18

标签: angularjs cordova ngcordova

我在cordova应用程序中使用了$ location.path

我正在使用angularjs的cordova应用程序。我已经成功登录到仪表板页面。

当我单击事件和组织标签时,对于某些具有所有标签的$location.path('')的特定页面,我会收到错误消息。

$ location.path在浏览器平台上使用时正常运行,但得到

  

错误:在Android设备上以调试模式运行时,[$ compile:tpload]。

$scope.aboutus = function () {
    $location.path("/aboutus");
}

$scope.notifications = function () {
   $location.path("/notifications");
}

$scope.cardHolderPage = function () {
   $location.path("/cardHolderPage");
}

$scope.getOwnCard = function () {
    $location.path('/ownCards');
}
$scope.getEvents = function () {
    $location.path("/events");
}
$scope.getOrganizations = function () {
   $location.path('/organizations');
}

$ scope.aboutus()和$ scope.contactus()函数正在运行,但是getEvents()和getOrganizations()正在运行,并给出错误消息:

  

错误:[$ compile:tpload]无法加载模板:views / loggedIn / VisitingCard / createVisitingCard.html(HTTP状态:-1)   http://errors.angularjs.org/1.6.9/$compile/tpload?p0=views%2FloggedIn%2FVisitingCard%2FcreateVisitingCard.html&p1=-1&p2=

Error: $templateRequest:tpload
Error Loading Template
     

无法加载模板:views / loggedIn / VisitingCard / createVisitingCard.html(HTTP状态:-1)

RouteConfig.js

myApp.config(["$routeProvider", function ($routeProvider) {

    $routeProvider
       when("/aboutus", {
            templateUrl: "views/LoggedIn/AboutUs/aboutus.html",
            controller: "DashboardController"
        }).when("/notifications", {
            templateUrl: "views/loggedIn/Notification/notifications.html",
            controller: "NotificationController"
        }).when("/events", {
            templateUrl: "views/loggedIn/Events/events.html",
            controller: "ViewEventController"
        }).when("/organizations", {
            templateUrl: "./views/loggedIn/Organizations/viewOrganizations.html",
            controller: "ViewOrganizationController"
        }).when("/cardHolderPage", {
            templateUrl: "views/loggedIn/CardHolders/cardHolder.html",
            controller: "CardHolderController"
        })
}])

HTML页面


<li class="list-group-item clickable" ng-if="premium_status == 'Premium'">
    <a class="list-group-item list-group-item-action" ng-click="getOrganizations()">
        <i class="far fa-building"></i>&nbsp;&nbsp; Organization
    </a>
</li>
<li class="list-group-item clickable" ng-if="premium_status == 'Premium'">
    <a class="list-group-item list-group-item-action" ng-click="getEvents()">
        <i class="far fa-calendar-alt"></i>&nbsp;&nbsp; Event
    </a>
</li>
<li class="list-group-item clickable" ng-if="premium_status != 'Premium'">
    <a class="list-group-item list-group-item-action" ng-click="premium()">
        <i class="fa fa-th"></i>&nbsp;&nbsp; Go Premium!
    </a>
</li>
<li class="list-group-item clickable">
    <a class="list-group-item list-group-item-action" ng-click="aboutus()">
        <i class="far fa-address-card"></i>&nbsp;&nbsp; About Us
    </a>
</li>

我只想将其路由到另一个页面。

0 个答案:

没有答案