我想知道是否有任何約定,如果我想實現twitter引導到我的angularJS應用程序或角度只是不顯眼的twitter引導?AngularJS和Twitter Bootstrap
0
A
回答
2
您需要在引導程序中分別引導bootstrap javascript組件以使其工作。下面是使模態JavaScript插件與角度一起工作的示例。
有一個活躍的社區Angular UI bootstrap它有效地實現了引導JavaScript插件作爲Angular指令。
我覺得,編寫我自己的指令使定製變得簡單,並且不需要在您的web應用程序中使用大量的JavaScript庫文件。
angular.module(app.name).directive('modaldir', function() {
return {
restrict: 'A',
// The linking function will add behavior to the template
link: function(scope, element, attrs) {
console.log("inside modal");
element.click(function(e) {
e.preventDefault();
var href = element.attr('href');
console.log(href);
$(href).modal();
});
}
};
})
HTML:
<a data-toggle="modal" href="#myModal" modaldir class="pull-right password-retrieve" >Forgot your password?</a>
+0
其實一些這個答案中的語句是不正確的:AngularUI團隊不會在指令中包裝Bootstrap的JavaScript,而是將這些JS組件重新實現爲本地AngularJS指令。這與AngularUI方法有很大不同,您不需要包含jQuery或Bootstrap的JavaScript - 您只需要Bootstrap的CSS。 –
+0
是的,你是對的。我編輯了我的答案 –
相關問題
- 1. Google reCAPTCHA + AngularJS + Twitter Bootstrap - Modal
- 2. Twitter Bootstrap腳手架與AngularJS
- 3. Twitter Bootstrap和Bootstrap-Xtra
- 4. Twitter Bootstrap和RoR
- 5. Require.js和twitter-bootstrap
- 6. Python和Twitter Bootstrap
- 7. twitter-bootstrap和html
- 8. Plone和Twitter Bootstrap
- 9. Twitter Bootstrap和ReCaptcha
- 10. Nivoslider和Twitter Bootstrap
- 11. Twitter Bootstrap和gmaps4rails
- 12. Symfony2和Twitter Bootstrap
- 13. angularjs和Twitter引導衝突?
- 14. Ember.js和Twitter Bootstrap Popover
- 15. Twitter Bootstrap和Spring MVC
- 16. Symfony2和Twitter Bootstrap glyphicons
- 17. backbone和twitter-bootstrap popover
- 18. HTML5 Boilerplate和Twitter Bootstrap
- 19. Twitter Bootstrap和圖像
- 20. angularjs和bootstrap javascript
- 21. angularjs自定義twitter bootstrap模態指令
- 22. twitter bootstrap popover不適用於angularjs
- 23. Angularjs Twitter Bootstrap指令 - 選項卡
- 24. Twitter Bootstrap VS Bootstrap
- 25. twitter-bootstrap中的bootstrap
- 26. Twitter Bootstrap跨度和行
- 27. Rails Asset Pipeline和Twitter Bootstrap Gem
- 28. cakePHP和Twitter Bootstrap - 查看
- 29. jsf和twitter bootstrap模式
- 30. Google Charts和Twitter Bootstrap標籤
值得注意的是,角隊有引導作爲其一部分的UI庫:http://angular-ui.github.io/bootstrap/ – gonzofish