Last active
August 29, 2015 14:12
-
-
Save staticnull/1dd2c1ad11fcb8382a9c to your computer and use it in GitHub Desktop.
Report Demo - HTML Button + Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- On an HTML page before the report --> | |
<button class="btn btn-success" ng-click="generateReport()"><span class="fa fa-file-pdf-o"></span> Generate Report</button> | |
<!-- demo.coffee --> | |
'use strict' | |
angular.module('demo').controller 'DemoCtrl', ($scope, $stateParams, $state, $q, $window, ReportService, profile, evaluation, group) -> | |
... | |
# Report | |
$scope.generateReport = () -> | |
# Returns stringified url | |
url = ReportService.reportUrl($stateParams.profileId, $stateParams.evaluationId, $stateParams.groupId, 'reportName') | |
$window.open(url) | |
# https://github.com/angular/angular.js/issues/4853 | |
return true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment