angularjs-directive

Headless Chrome not detecting css and Background image of the webpage

╄→гoц情女王★ 提交于 2020-03-26 03:56:29
问题 My pdf page don't take background image and any CSS of the page. Can you please tell me how to resolve this issue? const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto('https://sigview.sigmoid.io/app/#/signIn', {waitUntil: 'networkidle2', timeout: 0}); await page.waitFor(20000); await page.pdf({path: 'sigview.pdf', format: 'A4'}); await browser.close(); })(); It should take complete web page

Integrate JasperReports Viewer Like Component inside an AngularJs Component

女生的网名这么多〃 提交于 2020-03-05 07:03:27
问题 I have been researching this problem for some time and have seen few references (like this). I know the Viewer is a Swing component, but I would like to achieve something like integrating/having a container in which to preview reports. I have not seen any such component default provided by Angular. Has anyone attempted something similar or is it better to create own web components (Polymer-wise perhaps). Thanks in advance. 回答1: Probably this is not really possible, due to reasons above. Just

Component communication in angular 1.5

泪湿孤枕 提交于 2020-02-28 04:47:05
问题 Angular 1.5 component communication suggestions usually have output bindings to invoke methods on root controllers. Let's say I have a root component, and two child components. <root> <child-1></child-1> <child-2></child-2> </root> It'd like to react to a button click on component one by reading a value on component two and then doing something in the root. For example, child-1 is a directive which wraps a drawing library that attaches a drawing to its DOM node and has a variable to control

How to isolate async validity checks from controller to directive to solve DRY and isolated scope issues?

自闭症网瘾萝莉.ら 提交于 2020-02-25 04:44:05
问题 I find myself often repeating the following code in multiple controllers, one for each business object: $scope.original = {name:"John"}; $scope.status = {error:false}; $scope.editMode = false; $scope.cancel = function() { $scope.item = angular.copy($scope.original); $scope.editMode = false; }; $scope.edit = function() { $scope.editMode = true; }; $scope.item = angular.copy($scope.original); $scope.save = function(item) { // do something ajax here // if it comes back 409, mark as conflict if (

Is it possible to set ng-view to replace: true?

故事扮演 提交于 2020-02-24 03:59:11
问题 I'm integrating Angular into a web application and I noticed that the wrapper is messing with some of the CSS on the page. After researching into directives, I saw that custom directives can have a property called 'replace' to be set to true so that the templateUrl directly replaces instead of being wrapped in the directive's tags. Is there a way to do the same with ng-view, or more generally any Angular directive? Thanks for the help! 回答1: I think your best bet is to decorate the original ng

isolateScope() returns undefined when using templateUrl

末鹿安然 提交于 2020-02-19 07:58:53
问题 I have a directive that I want to unittest, but I'm running into the issue that I can't access my isolated scope. Here's the directive: <my-directive></my-directive> And the code behind it: angular.module('demoApp.directives').directive('myDirective', function($log) { return { restrict: 'E', templateUrl: 'views/directives/my-directive.html', scope: {}, link: function($scope, iElement, iAttrs) { $scope.save = function() { $log.log('Save data'); }; } }; }); And here's my unittest: describe(

isolateScope() returns undefined when using templateUrl

谁说胖子不能爱 提交于 2020-02-19 07:58:46
问题 I have a directive that I want to unittest, but I'm running into the issue that I can't access my isolated scope. Here's the directive: <my-directive></my-directive> And the code behind it: angular.module('demoApp.directives').directive('myDirective', function($log) { return { restrict: 'E', templateUrl: 'views/directives/my-directive.html', scope: {}, link: function($scope, iElement, iAttrs) { $scope.save = function() { $log.log('Save data'); }; } }; }); And here's my unittest: describe(

How to expose behavior from Element directive?

情到浓时终转凉″ 提交于 2020-02-06 06:46:30
问题 I ran into a problem adapting the solution from How to expose behavior from a directive with isolated scope?. I wanted to expose my directive as an Element rather than as an Attribute: Here's a JSFiddle. When you click the first button, which uses the Attribute approach, everything is ok. But the second button uses the Element approach and it gives an error. Here is the code as well: HTML: <div ng-app="main"> <div ng-controller="MyCtrl">Click the first button and everything is ok: <br>

How to expose behavior from Element directive?

萝らか妹 提交于 2020-02-06 06:45:06
问题 I ran into a problem adapting the solution from How to expose behavior from a directive with isolated scope?. I wanted to expose my directive as an Element rather than as an Attribute: Here's a JSFiddle. When you click the first button, which uses the Attribute approach, everything is ok. But the second button uses the Element approach and it gives an error. Here is the code as well: HTML: <div ng-app="main"> <div ng-controller="MyCtrl">Click the first button and everything is ok: <br>

AngularJS Directive for twitter bootstrap form-group

喜你入骨 提交于 2020-01-31 17:45:34
问题 I've been playing with angular lately, so far so good, but im struggling with directives. I'm trying to create a directive that generates the html mark up for a standard bootstrap form group with its corresponding validation messages. So basically I'm trying to convert this: <form-group label="Password"> <input type="password" data-ng-model="vm.password" name="password" id="password" class="form-control form-control-validate" required data-ng-minlength="6" data-required-error="Password is