michikono / angular-wait Goto Github PK
View Code? Open in Web Editor NEWAngular directive for delaying child directives from rendering
License: MIT License
Angular directive for delaying child directives from rendering
License: MIT License
I'm going to play around with this a little, but do you have any quick guidance on how I could leverage angular animations to smoothly transition between the two states provided by this directive?
I'm thinking just something as simple as fade out the loading content and immediately fade in the done content. I'm new to angular animations so thanks in advance for any help if you've considered this already.
Trying to get my head around the different use cases folks have for deferred directive loading from this ticket.
At first read, I thought most folks were looking to delay the execution of a post-link function and controller associated with a directive until after some dependencies had resolved. I noticed angular-wait
's slugline implies a focus on load state:
Angular directive for showing pending ("loading...") content
Another good use case.
I see it's transcluding content. When someone puts a directive inside <wait-done>
, do you know which steps would be executed BEFORE the wait resolves? compile
? controller
? pre-link
? post-link
? I think it would do the compile
but nothing else, right?
If all you need is deferred directive evaluation, a syntax that emphases the optional-ness and composability of the feature might be preferable:
<user-profile-form waits="user"></user-profile-form>
If the focus is on indicating load state, a syntax that emphasizes the either/or-ness of the situation may be better, like what you have now.
Anyway, sort of thinking out loud, but also trying to figure out how many of the steps in the compile process are possible to defer.
Do you know off hand if it's possible to nest wait directives inside each other? Something like
<wait until-not-null="relativelyQuickProperty">
<wait-loading>...</wait-loading>
<wait-done>
...a bunch of content...
<wait until-not-null="someDelayedValue">
...
</wait>
</wait-done>
</wait>
I'm hoping to use this to show a status page, but one where the critical values load and show relatively quickly, and some supporting graphs are shown once their data is fetched (which takes longer).
Some initial testing shows that the inner wait seems to cause them all to wait, but I'm a little over me head on how these nested directives would interact.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.