last day (21 days later) » 

1:33 PM
hi :)
@messerbill :)
 
hey
sorry
okay
how long did you work with angular yet?
 
not that long...i know basic stuff..why?
 
i don't know why you want to need ng-init
in most cases you dont need it
CancelPayOutTicket
is this function found?
 
for now its not
forget about that function
:)
 
ok
and the other ones?
every function you defined under $scope does workß
?
 
1:39 PM
yes
 
can you send me a link to the site?
 
its not online...its local
 
ok and when you hit the button you get a blank white page?
does the console print some errors?
 
no its just open print option but i get blank white page
that is when i dont use delay with 1000ms
when i put setTimeout then it open partial view and after that it call print function but i dont like that
its hackish
:)
 
where is your link to the other site?
 
1:42 PM
$scope.ConfirmTicketPayOut = function (ticketPin, username) {
$scope.ticketPin = ticketPin;
localStorage.setItem("pin", ticketPin);
accountDataProviderService.confirmTicketPayOut(ticketPin, username)
.then(function (response) {

$scope.confirmTicketPayOut = response;
if ($scope.confirmTicketPayOut.Result == true) {

$window.open('/print');



}
});
localStorage.clear();
}
 
don't you want to define a "action" in your formular?
ah ok
 
how u mean action ?
 
it looks like the path "/print" is not found
try absolute path for testing plz
 
it open page its just when i close print options then i can see that page if u know what i mean
 
no sry xD how can you "close" print options?
 
1:45 PM
well when u click now ctrl + p u have cancel and print and thats how i mean..when i cancel it close print option and then "new page " pop out :D
 
hm strange...a fiddle really would help here
where is the problem with fiddle?
i can help u setting it up
 
problem is that i dont know how to set up basic stuff for angular in fiddle
like controllers and things like that
here in visual studio i know :D
 
hm, i will set up a little angular app in fiddle, wait a moment
 
ok i will wait :)
 
hm just a moment :D
ok
this is a basic angular app
you can edit it
and send me the fiddle
i gonna smoke a cigarette, you will take a moment anyway :D
 
2:02 PM
lol okay i will try :D
how can i add "new page" ?
@messerbill smoke faster :P
 
i am back
just make an example without the new page
but with everything else
the complete controller of the first page
and the complete first page
 
everything else is just checking
main problem is this
 
4 :D
updated 4 times? :D
 
lol
:D
like i said im not good at it
haha
so main problem is this : when i click on print
 
nah np, we will get this
 
2:12 PM
it call print options but just blank page
when i use just $windows.open("/print")
it open page
with content
so url is working :)
 
just try it this way
and
add this line:
$window.print();
to your controller of the new page
this should work i think
 
in this way i get fiddle.jshell.net/newPage not found but not call print option
 
where are you from man? :D
yes of course
 
from bosnia man :D
 
because jsfiddle does not have that new page
 
2:17 PM
i know but it should open that "new page" and call print option for that page
 
you should use the controller of the "latest" fiddle i posted you in your real project
and add $window.print(); to the controller of the new page
did you define an angular controller for the new page?
bosnia is not that far away :D i am from germany^^
 
cool :D
there are lots of bosnians there :D
 
indeed :D
i know some xD
 
bad ones? :D
 
do you have a controller for the new page?
nah, very nice guys and girls
that one girl is too sexy :D
 
2:18 PM
haha :D
i dont have controller for new page...i think D
:D
all i have is partial view
 
you should create one
 
for that "second page"
wait ...i have but its different from controller that i have on first page
 
your second site needs to do the print command, best way would be another angular controller
of course, the second controller is different because it is not the same one^^
 
is it problem if they are both on same controller
<div ng-controller="accountContentController">
??
 
you need different controllers because they shall do different jobs
just like
 
2:22 PM
then i will need to do emit or ??
between controllers?
 
yourApp.controller("newPageController", function($window) {
$window.print();
}
and at the new page some HTML like
<div id="newPage" ng-controller="newPageController"></div>
 
ok i will create new contoller now
 
of course "yourApp" must be the var name of your app
 
there i create :D
its called printController
 
can you post it?
HTML and Javascript
of the new page / new controller
 
2:26 PM
'use strict';
angular.module("accountModule").controller('printController', ['$scope', '$rootScope', '$anchorScroll', 'accountDataProviderService', 'mainConfigService', function ($scope, $rootScope, $anchorScroll, accountDataProviderService, mainConfigService) {



}]);
this is angular
<div id="printWrapper" style="background-color:white;" ng-controller="printController">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<!-- HEADER -->
<tr>
<td>

<img id="imgLogo" src="@Model.TicketPayOut.Logo" />


</td>
</tr>
<!--HEADER-->
<tr>
<td>
<label id="lblTerminalId" class="left-position padding-top-3 padding-left-3 text-style">@Translator.Translate("TERMINAL")</label>
<span class="left-position padding-top-3 text-style">:</span>
<label id="lblTerminalIdValue" class="left-position padding-top-3 padding-left-3 text-style"></label>
and there is html page
of new page
 
ok add $window.print(); into the controller function
 
ok and then what? :D
 
you need to inject $window at the params
 
ok
 
angular.module("accountModule").controller('printController', ['$scope', '$rootScope', '$anchorScroll', 'accountDataProviderService', 'mainConfigService', function ($window) {
$window.print();


}]);
sry
 
2:28 PM
'use strict';
angular.module("accountModule").controller('printController', ['$scope', '$rootScope', 'window', function ($scope, $rootScope) {

$window.print();

}]);
 
angular.module("accountModule").controller('printController',, function ($window) {
$window.print();


}]);
 
$window
 
try this
what i posted
mom there is still an error
 
'use strict';
angular.module("accountModule").controller('printController', ['$scope', '$rootScope', '$window', function ($scope, $rootScope,$window) {

$window.print();

}]);
like this
:D
 
angular.module("accountModule").controller('printController', function ($window) {
$window.print();
});
this should work
 
2:29 PM
okey
now what?
 
did you implement it?
 
yes
where i need to call this function now and how
 
just try it
if u did correctly it should work now
if not please post your complete angular module with all controllers
do you also use ng-route?
 
im using ui.route
 
thats what i meant, sorry^^
 
2:32 PM
$scope.print = function ()
{
    $window.open("/print");

} im using this on first page
 
does it work?
 
but i get just page
not a print function
 
yea
the print function should be executed when new page is loaded
thats why we added it into the new page controller
is there an error in the console?
 
let me see
 
please show me your complete angular code
just the JavaScript
 
2:33 PM
rror: [ng:areq] Argument 'printController' is not a function, got undefined
 
nice ok
so you did not define it correctly
please post the complete angular javascript
2 observers now :D
 
'use strict';
angular.module("accountModule").controller('printController', ['$window', function ($window) {

$window.print();

}]);
this is print function
 
no please just show
everything
idc if this takes longer now....i will finish work in 90 minutes xD thats the time we have got to solve your problem :D haha
 
everything of what
 
of your AngularJS JavaScripts
 
2:36 PM
angular.module("accountModule").controller('accountContentController', ['$scope', '$http', '$window','$timeout', '$rootScope', '$location', 'accountDataProviderService', 'mainConfigService', function ($scope, $http, $window,$timeout, $rootScope, $location, accountDataProviderService, mainConfigService) {
$scope.print = function ()
{
$window.open("/print");

}
}]);
 
is this the complete file?
 
<input type="submit" value="@Translator.Translate("CANCEL")" class="btn btn-block secondary-button save-changes padding-8" ng-click="print()" />
i have some other function but they are not important for this part
i know what it
is
i didnt put it in bundlee
i didnt call printcontroller anywhere
:DF
 
they are - i need to see where you implemented the other controller
and i would rename "print()" function of the accountContentController because the function opens up the new page and prints nothing :D
look - thats the way i always implement my controllers
 
i didnt includ printController on page :D
 
var testApp = angular.module('testApp', ['ngRoute']);

testApp.controller('textEditorController', ['$scope', function($scope) {

}]);
testApp.controller('previewController', ['$scope', function($scope) {

}]);
testApp.controller('naviController', ['$scope', function($scope) {

}]);
testApp.controller('modalBoxController', ['$scope', function($scope) {

}]);
you dont need all of those injects too
 
2:41 PM
problem is with printController
and i sent u all about print controller
 
ok bro
just wait a second
 
ok
 
try it that way
var accountModule = angular.module("accountModule");
accountModule.controller('accountContentController', ['$window', function ($window) {
$scope.load = function ()
{
$window.open("/print");

}
}]);

accountModule.controller('printController', ['$window', function ($window) {
$scope.load = function ()
{
$window.print();

}
}]);
and html at the new page like:
<div id="newPage" ng-controller="printController"></div>
 
yes
wait
i dint put $scope.load = function ()
{
$window.print();

}
 
yes, take all the time u need
 
2:46 PM
just $window.print
 
i renamed it, because its senseless otherwise^^
oh sry
in the second controller, the printController it should be named "print" of course
var accountModule = angular.module("accountModule");
accountModule.controller('accountContentController', ['$window', function ($window) {
$scope.load = function ()
{
$window.open("/print");

}
}]);

accountModule.controller('printController', ['$window', function ($window) {
$scope.print = function ()
{
$window.print();

}
}]);
and change your ng-click="print()" to ng-click="load()"
 
can u leave me email address pls :D
because i need to go now :)
 
lol :D i can but you can write here too i think^^
ole.hoppe@gmx.de
later when i am at home we can start a team viewer session if you want to
so i can see all the code you have written
 

  last day (21 days later) »