jmcox
jmcox

Reputation: 86

Can I merge Angular Strap's "aside" directive into Angular UI somehow?

I don't really have code to show. I thought just maybe it'd be as simple as copying the module directive from angular strap over to ui bootstrap, but that's very obviously been proven incorrect. Has anybody else tried doing this with any success? To reiterate, I want to be able to use the aside module of Angular Strap with AngularUI Bootstrap.

Upvotes: 0

Views: 1674

Answers (2)

Alex Coroza
Alex Coroza

Reputation: 1757

Just like @Don said in his comment, aside requires modal directive from ngStrap that will conflict in ui-bootstrap's modal directive. But theres still a solution.

The solution is quite simple and I only had to add one dependency to get the basic CSS from the AngularStrap CSS project although this is not really needed but saves some time. The dependency is bootstrap-additions and you only need the aside.less file or the CSS if you prefer.

The code is pretty simple because the angular-ui modal component allows to use custom templates for the modal content but also for the modal container so you are not restricted to Bootstrap modal, you can create your own.

$modal.open({
    templateUrl: ‘your.modal.template.html’,
    windowTemplateUrl: ‘aside.template.html’
});

Heres is the full tutorial/solution where I got the answer. Credits to him.

Upvotes: 0

MBielski
MBielski

Reputation: 6620

Both products are constructed so that you can pick and choose which parts to use. If you look at Github you'll find the separate source for Aside:

https://github.com/mgcrea/angular-strap/blob/master/src/aside/aside.js

Download that and include it in your project.

Upvotes: 1

Related Questions