Angular Google Maps – polyline works on Stackblitz but not locally - angular-google-maps

I need to wrap a div tag inside of an agm-polyline so it will accommodate both an ngFor and ngIf directive on the same agm-polyline-point tags. Example:
<agm-polyline [strokeColor]="'blue'">
<div *ngFor="let waypoint of waypoints">
<agm-polyline-point *ngIf="boolean" [latitude]="waypoint.lat" [longitude]="waypoint.lng"></agm-polyline-point>
</div>
</agm-polyline>
Adding the wrapped div results in the polyline no longer showing up in my browser when accessing on my computer from localhost:4200. However, when I run the code on Stackblitz it works perfectly.
Any ideas why this is happening? I've tried it locally on two versions of #agm/core (1.0.0 and 3.0.0-beta.0) with the same results each time.
Github is here.

Use ng-container instead of div.
When you use div tags, they are inserted into the DOM, which can interfere with the styling and structure of the page.
In contrast, ng-container tags are excluded from the DOM, but can use ngIf and other Angular constructs just as you are now.
<agm-map [latitude]="lat" [longitude]="lng">
<agm-polyline [strokeColor]="'blue'">
<ng-container *ngFor="let waypoint of waypoints">
<agm-polyline-point *ngIf="boolean" [latitude]="waypoint.lat" [longitude]="waypoint.lng"></agm-polyline-point>
</ng-container>
</agm-polyline>
</agm-map>

Related

Deled special tgas inckeditor

I have this line in code into a longtext field in ckeditor:
<div style="width:100%"> <canvas id="canvas3"></canvas></div>
but when I save then delete and replace by:
<div style="width:100%"> </div>
so delete all: I use to show graphics. Any idea to solved it?
Thanks
You need to add config.extraAllowedContent = 'canvas[*]{*}(*)'; inside your config.js. Basically none of existing plugins has reported canvas element to Advanced Content Filter (ACF) thus they get removed. This filter lets you decide what tags, attributes, styles and classes can be used inside the editor.
Once you add this, please simply switch to source mode. If canvas are there it means CKEditor is fixed and it no longer removes that tag. If the tag, despite being in editor, still isn't saved in your data base, please check your server-side code for potential HTML filters.
If you wish learn more about ACF, please see:
https://docs.ckeditor.com/ckeditor4/latest/guide/dev_acf.html
https://docs.ckeditor.com/ckeditor4/latest/guide/dev_advanced_content_filter.html
https://ckeditor.com/docs/ckeditor4/latest/guide/dev_disallowed_content.html
https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-allowedContent
https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-extraAllowedContent
https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_config.html#cfg-disallowedContent
https://ckeditor.com/docs/ckeditor4/latest/api/CKEDITOR_filter.html#method-addTransformations

What is the DOM structure of tooltips in Joomla 3?

I am using a form in a front-end view of my website. The labels of the input fields show hints/tooltips when hovering over them with the mouse. I would like to style these tooltips with the css of my front-end template. Therefore I need to know the DOM structure of these tooltips.
Somehow, I can not find any documentation about this and using 'Inspect element' in Google Chrome also doesn't help me, because the tooltip is removed as soon as I do not hover the label anymore while trying to inspect them.
Help is very much appreciated!
Default tooltips in joomla back office have this structure, I'm pretty sure that it is the same in front office :
<div class="popover fade right in">
<div class="arrow"></div>
<h3 class="popover-title">[TITLE]</h3>
<div class="popover-content">[TEXT]</div>
</div>

how to build carousal using ng2-bootstrap without knowing how many image you want to use in advance?

i am working on project using ASP.net Api and angular and i want to build carousal using ng2 bootstrap but i dont know how many images i will? any suggestion how this can be done.
You can check demo with source code http://valor-software.com/ng2-bootstrap/#/carousel
Pay attention how "add slide" button works, this is what you need to replicate
If you have an array of image urls, you can use the angular *ngFor syntax to loop through the images, causing the output to change depending on the array.
TypeScript: let images = ['image1.jpg', 'image2.jpg'];
HTML:
<div class="carousel-wrapper">
<div *ngFor="let image of images">
<image [src]="image" />
</div>
</div>

jsPlumb multiple containment are not working together. is this bug?

I have following HTML
<div id="leftpanel">
<div id="top"></div>
<div id="middle"></div>
<div id="bottom"></div>
</div>
I am adding draggable through JS dynamically. And using following JS code to make them draggable.
jsPlumb.draggable($("#top .draggable"),{containment:"#top"});
jsPlumb.draggable($("#middle .draggable"),{containment:"#middle"});
jsPlumb.draggable($("#bottom .draggable"),{containment:"#bottom"});
It shows me draggble in right containers. But when I star dragging, it suddenly moves selected draggable into top container. And when I drag it outside of top container it don't let me.
I have tried setting position of draggable to : relative,absolute. But it dint solve the problem .
Edit:
if I use
$("#divId").draggable({containment:container});
it works fine. But connections don't get dragged along with dvs. If I do following
jsPlumb.draggable($("#divId"),{containment:container});
then connections move along with divs but above mentioned problems occurrs ie div automatically moves to top conteiner.
in your jsfiddle you're not using jquery.jsPlumb-xxx-min.js

DOMDocument and FBML/Google + Button not working

Well I'm having a bit of an issue, I have an application that uses DOMDocument to display some content but it is removing some code that is needed for FBML and a Google +1 button to display.
For example, Facebook's like button is <fb:like>, it is removing fb: from the string. Google's +1 button is like <g:plusone> and it's removing g:.
Is there any way to make it not remove that part of the code?
You can solve both issues.
With Facebook like button, you will want to use the HTML5 version. See: https://developers.facebook.com/docs/reference/plugins/like/
ex: <div class="fb-like" data-send="true" data-width="450" data-show-faces="true"></div>
With Google's Plus one you can use the HTML5 version as well. See: https://developers.google.com/+/plugins/+1button/
ex: <div class="g-plusone" data-size="tall" ... ></div>

Resources