TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Edison Augusthy
NA
52
6.6k
not showing printing option
Sep 15 2016 5:44 AM
i have created an app using ionic to print a page but its not showing printing option
here is my Index code
<!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 rel=
"manifest"
href=
"manifest.json"
>
<link href=
"lib/ionic/css/ionic.css"
rel=
"stylesheet"
>
<link href=
"css/style.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=
"js/ng-cordova.min.js"
></script>
<script src=
"cordova.js"
></script>
<!-- your app's js -->
<script src=
"js/app.js"
></script>
</head>
<body ng-app=
"starter"
>
<ion-pane>
<ion-header-bar
class
=
"bar-stable"
>
<h1
class
=
"title"
>Print</h1>
</ion-header-bar>
<br>
<br>
<ion-content ng-controller=
"ExampleController"
>
<button
class
=
"button"
ng-click=
"print()"
>Print Webpage</button>
</ion-content>
</ion-pane>
</body>
</html>
and app.js is
var
a = angular.module(
'starter'
, [
'ionic'
,
'ngCordova'
]);
a.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();
}
});
});
a.controller(
"ExampleController"
,
function
($scope, $cordovaPrinter) {
$scope.print =
function
() {
if
($cordovaPrinter.isAvailable()) {
$cordovaPrinter.print(
"https://www.nraboy.com"
);
}
else
{
alert(
"Printing is not available on device"
);
}
}
});
am getting these errors
Error: [$injector:modulerr] Failed to instantiate module ng-cordova due to:
Error: [$injector:nomod] Module 'ng-cordova' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
Reply
Answers (
1
)
New tab in angular js report.
Angularjs html5Mode page refresh breaks the routing in asp