What is an AngularJS directive?

前端 未结 5 2052
陌清茗
陌清茗 2020-12-12 08:44

I have spent quite a lot of time reading through AngularJS documentation and several tutorials, and I have been quite surprised at how unapproachable the documentation is.

5条回答
  •  暖寄归人
    2020-12-12 09:16

    Maybe a really simple and initial definition for angular directives would be

    AngularJS directives (ng-directives) are HTML attributes with an ng prefix (ng-model, ng-app, ng-repeat, ng-bind) used by Angular to extends HTML. (from: W3schools angular tutorial)

    Some examples of this would be

    The ng-app directive defines an AngularJS application.

    The ng-model directive binds the value of HTML controls (input, select, textarea) to application data.

    The ng-bind directive binds application data to the HTML view.

    Name:

    Check this tutorial , at least for me it was one of the best introductions to Angular. A more complete approach would be everything that @mark-rajcok said before.

提交回复
热议问题