Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing AngularJS / AngularUI with d3.js and DOM effects
    primarykey
    data
    text
    <p>I'm interested in using AngularJS for a project I'm working on. I've read a lot about it, watched the videos, done several sample apps. It all makes sense, I buy into the concepts.</p> <p>The project I'm doing needs to do some DOM special effects (moving things around the page dynamically, etc.) and incorporate some D3.js charting.</p> <p>I've used jQuery a lot; I get it and like it. I've used AngularJS enough to get the basics. I completely don't understand how to call things like jQuery's <code>$("#my-element").slideUp()</code> from within Angular. For example:</p> <p>Let's say I have the following HTML in a page somewhere:</p> <pre><code>&lt;!-- somewhere in app.html --&gt; &lt;div id="my-element"&gt; &lt;p&gt;Here's some data about your stuff...!&lt;/p&gt; &lt;button id="hider"&gt;Hide this (but with a cool transition)&lt;/button&gt; &lt;/div&gt; </code></pre> <p>And in the site JS:</p> <pre><code>// somewhere in app.js ... pretend it's all nice and DRY. function main () { $("#my-element button") .click(function () { $("#my-element").slideUp()}); } $(main); </code></pre> <p>The best I can tell for how to accomplish something close to this for Angular is:</p> <p>HTML</p> <pre><code>&lt;!-- somewhere in app.html --&gt; &lt;div ng-controller="Data"&gt; &lt;p&gt;Here's some data about your stuff...!&lt;/p&gt; &lt;button ng-click="slideUp()"&gt;Hide this (but with a cool transition)&lt;/button&gt; &lt;/div&gt; </code></pre> <p>CSS:</p> <pre><code>// somewhere in app.css function Data ($scope) { $scope.slideUp = function () { $("#my-element").slideUp(); } } </code></pre> <p>Somehow that feels like it's not the right approach, but I don't know what the right approach is.</p> <p>I see that there's an AngularUI project that looks neat... but the "documentation" assumes the reader is pretty deeply familiar with Angular, instead of a newcomer.</p> <p>I'm completely willing to buy the idea of Angular that a declarative syntax with data binding for html is the way to go, and I'm willing to go whole-hog and adopt the style, conventions, or whatever. But I can't figure out how to get started with more than simple presentation stuff.</p> <p>Can someone point me to a sample project that uses (and preferably demonstrates the use of):</p> <ul> <li>AngularJS</li> <li>jQuery</li> </ul> <p>Bonus if there's some mention of D3 =) I don't especially care about jQuery-UI, but it doesn't hurt me for it to be there.</p> <h1>Note</h1> <p>I saw <a href="https://stackoverflow.com/questions/12472244/how-to-integrate-angularui-to-angularjs">this question</a>, but the answers were, again, not very helpful for a newcomer to Angular.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload