我正在使用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)
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"
})
}])
<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> 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> 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> 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> About Us
</a>
</li>
我只想将其路由到另一个页面。