Angular Directive Syntax in HAML
<p>I cannot get the syntax right - how do you add a directive to a haml template?</p>

<p>Let's say I have a directive called `my-directive'. I would like to put that into a haml template.</p>

<p><strong>Attempt 1:</strong> Straight html syntax</p>

<p><code>&lt;my-directive&gt;&lt;/my-directive&gt;</code></p>

<p>Obviously, doesn't work.</p>

<p><strong>Attempt 2:</strong> As a class</p>

<p><code>.my-directive</code></p>

<p><strong>Attempt 3:</strong> Using ng syntax</p>

<p><code>{:ng =&gt; 'my-directive' }</code></p>

<p><strong>Attempt 4:</strong> Using data</p>

<p><code>{ :ng =&gt; { :data =&gt; "newDirective" } }</code></p>

<p><strong>Attempt 5:</strong> Using html/haml element </p>

<p><code>%my-directive</code></p>

<p><strong>Attempt 6:</strong> Wrapping div with ng</p>

<p><code>%div{ :ng =&gt; 'my-directive' }</code></p>

<p><strong>Attempt 7:</strong> Wrapping div with data</p>

<p><code>%div{ :ng =&gt; { :data =&gt; "newDirective" } }</code></p>

<p>None of these worked. </p>

<p><strong>Resources consulted:</strong> </p>

<p><a href="https://stackoverflow.com/questions/15895551/using-angularjs-within-haml-views-of-a-rails-app">Using AngularJS within Haml views of a Rails app</a></p>

<p><a href="http://www.writelessdomore.co.uk/category/haml/" rel="nofollow noreferrer">HAML/Angular tutorial</a></p>

<p><a href="https://github.com/haml/haml/issues" rel="nofollow noreferrer">HAML Github Issues</a></p>

<p><a href="https://www.reddit.com/r/angularjs/comments/28lfhs/angularjs_and_haml_what_ways_can_we_add_a/" rel="nofollow noreferrer">Reddit Question</a></p>