Reconcile Angular.js and Bootstrap form validation styling

前端 未结 12 2081
刺人心
刺人心 2020-12-22 18:53

I am using Angular with Bootstrap. Here is the code for reference:

12条回答
  •  没有蜡笔的小新
    2020-12-22 19:37

    It's hard to tell for sure without a fiddle but looking at the angular.js code it does not replace classes - it just adds and removes its own. So any bootstrap classes (added dynamically by bootstrap UI scripts) should be untouched by angular.

    That said, it does not make sense to use Bootstrap's JS functionality for validation at the same time as Angular - only use Angular. I would suggest you employ the bootstrap styles and the angular JS i.e. add the bootstrap css classes to your elements using a custom validation directive.

提交回复
热议问题