

AngularStrap - Bootstrap directives for AngularJS - xsace
http://mgcrea.github.com/angular-strap

======
phpnode
looks nice, but one thing I really don't get is how

    
    
        <a ng-click="modal.saved=true;dismiss()">...</a>
    

is any different to

    
    
        <a onClick="thisIsAnAntiPattern()">...</a>
    
    

I'm all for declarative code but isn't stuffing javascript in html attributes
something we learnt not to do about 10 years ago? Why the resurgence?

~~~
JanLaussmann
An interesting discussion about the difference between

    
    
      <a ng-click="modal.saved=true;dismiss()">...</a>
    

and

    
    
      <a onClick="thisIsAnAntiPattern()">...</a>
    

and why context / scope matters could be found here:
[http://www.bennadel.com/blog/2439-My-Experience-With-
Angular...](http://www.bennadel.com/blog/2439-My-Experience-With-AngularJS-
The-Super-heroic-JavaScript-MVW-Framework.htm#comments_41586)

~~~
phpnode
thanks, that was interesting and it's obvious how it can be useful. but for
some reason it still feels dirty.

------
goodwink
It seems to solve a very similar problem to Angular UI's bootstrap project:
<http://angular-ui.github.com/bootstrap/>

~~~
trimbo
Yup. I guess the differenece is no dependency on angular-UI and it cuts
straight to the bootstrap part.

~~~
jimrhoskins
I don't believe ui.bootstrap actually depends on angular-ui, the project is
just rolled into angular-ui's brand/github org. They could probably be more
clear about that.

All three of them (angular-ui, ui.bootstrap, angular-strap) have been a
pleasure to work with.

~~~
pkozlowski_os
You are right, this project has _zero_ dependency on any other external
JavaScript code. Those are native AngularJS directives.

------
nateabele
Can we please stop posting links to this project? It's a really good example
of how _not_ to write Angular code.

The (official) AngularUI project has a much better solution (as has already
been linked to in previous comments, but I feel the need to re-iterate):
<http://angular-ui.github.com/bootstrap/>

~~~
1qaz2wsx3edc
Considering every component provided by AngularBootstrap is tested, I think
what you're saying is false.

Can you show us how they're wrong?

~~~
kailuowang
Compare the code yourself (should be an easy comparison) bootstrap alert
widget

angular UI version [https://github.com/angular-
ui/bootstrap/blob/master/src/aler...](https://github.com/angular-
ui/bootstrap/blob/master/src/alert/alert.js)

strap version [https://github.com/mgcrea/angular-
strap/blob/master/src/dire...](https://github.com/mgcrea/angular-
strap/blob/master/src/directives/alert.js)

~~~
pkozlowski_os
And more examples like this, unfortunately... Compare buttons for another
striking example...

------
hanula
AngularJS is _very_ interesting, simple and powerful, but can anyone give some
insights of how to properly use it for just a part of the website? I don't
want to have JS only webapp, but to serve full server-generated pages. Or
maybe it's wrong tool for the job?

~~~
marknutter
It works just fine for that purpose. Just include angular.js and add an ng-app
and ng-controller directive to a div you want angular to be concerned about
and you're on your way. We are going to transitioning our javascriptMVC app
over to an angular.js app piecemeal by following the same strategy.

