Angularjs, SVG, $route and ui-bootstrap Modal - url(#id) breaks - angularjs

This issue must be similar to other reported problems involving SVG patterns referenced by url(#fill-ID). I have tried many of the suggestions found here including setting <base> and html5mode, using a directive, $location.absUrl() and so on.
In my situation, I have an SVG that is created using ng-repeat on an array. I want to pop this SVG into a modal using the same controller and template. All is good until the modal is closed. At that point the fills and other SVG elements that are added, the url() attributes fail.
I have created this plunk Angular with SVG and Modal. Differences between the plunk and my code are that the partial svg.html is located in a sub-directory off the root.
My application and plunk work just fine in Firefox and IE11, but in Chrome, the url(#) does not resolve and hence the fills are blank.
It seems like I am Alice chasing a rabbit down the rabbit hole.

Related

Draggable element in iframe on mobile is buggy

I'm creating a third-party app, which is loaded through an iframe.
The iframe creates a draggable element in side it.
On first page load (before scrolling the page), the draggable (slider) works fine.
But after scrolling the page behind the iframe, it's hard to get the slider to slide again.
(Note that this is a mobile issue, safari on iOS especially, but also chrome on iOS)
In the following demo I have used the GSAP Draggable library with react to create the draggable element but have also tried to code it in plain react with no luck.
Here is a demo: https://unfjl.csb.app/
I have tried a lot of different things (css, touchevents etc), but cannot get it to work...
What could cause this behaviour?
Update (no iframe example)
Demo no iframe: https://p5cu9.csb.app/
Same example with slider as above, but in this example the draggable is rendered directly in the DOM and not in an iframe. The problem still occurs. I suspect it has something to do with the fixed css position of the slider...
This is gonna sound really strange, but a bug in iOS Safari causes that and the only way I know of to get around it (which I discovered today via Googling) is to add a "touchstart" listener to the of the top-level page (not the iframe)!
document.getElementsByTagName("body")[0].addEventListener("touchstart",function(){});
That isn't something I can add to Draggable because it wouldn't be able to access the parent document (outside the iframe) to add that properly (security restrictions in the browser).
You could also add a touchforcechange listener that prevents the default behavior (I'll be adding that to Draggable itself too):
yourDraggableElement.addEventListener("touchforcechange", function(event) {
event.preventDefault();
});
Browser bugs are fun, aren't they?! ;)
(Originally answered in the GreenSock forums at https://greensock.com/forums/topic/21450-draggable-in-iframe-on-mobile-is-buggy/?tab=comments#comment-101225)

how to show progress circular in angularjs single page application

I want to use progress circular in my SPA(single page application) and i done it but there was an issue that the shape of circle is showing worse.
For clear understanding i provide an image of circular which was showing in my application.enter image description here
but i don't understand why the shape of this is showing worse, i don't know, please help me to come out from this problem.
I Found my soulution
a css file in my html file is conflict with the angular js material css file.
so, when i remove that file then everything is perfect.

AngularJS window does not render (blank page) but resizing window renders it

I have this weird issue with my angular app. It doesn't happen every time but I've been able to consistently reproduce it if I click to it as quickly as I can as soon as my angularjs app loads.
Basically my right pane directive will sometimes render a blank page. This page however appears when I resize the browser window a little bit.
I'm not even sure where to begin looking to resolve this bug. I tried messing around with $timeout and $scope.$apply but it didn't seem to do anything.
Has anyone seen anything like this before and if so, how did you resolve it?
Note the directive I use does use ng-include with a value that is dynamically generated from the custom directive's associated controller.
P.S. Another oddity, if I move my mouse over the allow main dock then it loads the page too. (I assume it's doing an unfocus action on the browser window.) I wanted to see if this was a browser specific issue because of this. Looks like it's only Chrome where this is a problem, as I can't reproduce the problem on firefox.
Same problem caused by CSS - display: table, found a solution by changing it to display: inline-block, so check if you have a such.

Directives not working on dynamically loaded content

I have a weird situation. I created 2 directives in my application.
orgNavigation
menuEnhancer
orgNavigation is responsible to build the html structure and menuEnhancer is to apply DOM specific logic. Both working great with static data but when the dynamic data is introduced, menuEnhancer is not working.
To test the behavior of menuEnhancer, click on any menu item. It should bring popup, which is working fine in static loaded template. But for dynamic loaded template, popup is not working.
I am thinking it might be because menuEnhancer link is executing before the navigation items loaded. Can anyone help how to fix it?
Plnkr

angularjs with absolute positioned elements in page

I got this project where the footer is absolute positioned to the bottom. It looks nice but if I load a page where angular is about to inject some long content the div initially renders at the bottom of my screen then the content is injected and the div remains there even though the page got a lot bigger.
This question is more towards the angular community, I probably can hack it with javascript to recompile the layout somehow but I'm just wondering if there are other possible solutions out there.
You might want to have a look at ngCloak, and tag your footer with it while the injected content loads.
http://docs.angularjs.org/api/ng.directive:ngCloak

Resources