1

I have a Yeoman scaffolded Angular-JS+Twitter Bootstrap seed project. I use the Bootstrap navbar on every page of the site for, you guessed it, navigation.

What is the best way to include this in an Angular project... directly within index.html, as a view? Ideally I ought to encapsulate the entire navbar div as a template and simply call it out, just not sure exactly how to do so.

4

1 回答 1

2

如果它应该包含在每个“页面”中,请使用 ng-include 将其包含在您的 index.html 中。

你会有类似的东西:

<body>
   <div ng-include='"path/to/partials/navbar.html"'></div>
   ...
</body>
于 2012-12-21T23:00:43.167 回答