What's the use of Jade or Handlebars when writing AngularJs apps

前端 未结 10 1179
情歌与酒
情歌与酒 2020-12-07 08:38

I am new(ish) to the whole javascript full stack applications, and completely new to Angular, so I was hoping somebody can put the record straight for me here.

Why w

10条回答
  •  南方客
    南方客 (楼主)
    2020-12-07 09:00

    I use Jade to generate templates consumed by AngularJS because I hate writing plain HTML. It looks something like:

    .control-group(
      ng-form
      name='emailGroup'
      ng-class='{"ng-error": emailGroup.$invalid}'
    )
      label.control-label Email
      .controls
        input(
          type='email'
          ng-model='user.email'
          required
          placeholder='you@example.com'
          focus-on='focusEmail'
        )
    

    … which I think is a lot cleaner than plain HTML.

提交回复
热议问题