This repository was archived by the owner on Apr 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Dev Guide: Anti Patterns
Adrian edited this page Dec 20, 2017
·
2 revisions
Related: Dev Guide: Best Practices
- Don't wrap
element
inside of$()
. All AngularJS elements are already jq-objects - Don't do
if (!$scope.$$phase) $scope.$apply()
, it means your$scope.$apply()
isn't high enough in the call stack. - Don't use jQuery to generate templates or DOM
- Don't create a new plugin without trying to discover, fork and pull request existing plugins first
- Don't use a scalar variable (null is scalar) as a model within an isolate scope (such as ng-if). (Example: http://embed.plnkr.co/qRhLfw/preview)