什么代码是这个??? {{phrase.addAdministrator}}

时间:2015-08-28 16:02:42

标签: javascript php function shortcode

我遇到过一个包含此类代码的应用程序,我不明白 {{phrase.addAdministrator}} 是什么以及它来自哪里?

<section class="content" ng-show="views.list"><a ng-click="changeView('add')" class="floatRTL btn btn-success btn-flat pull-right marginBottom15">{{phrase.addAdministrator}}</a>  
  <div class="box col-xs-12">
      <div class="box-header">
          <h3 class="box-title">{{phrase.listAdministrators}}</h3>
          <div class="box-tools">
              <div class="input-group">
                  <input type="text" name="table_search" ng-model="searchText" class="form-control input-sm pull-right" style="width: 150px;" placeholder="{{phrase.Search}}">
                  <div class="input-group-btn">
                      <button class="btn btn-sm btn-default"><i class="fa fa-search"></i></button>
                  </div>
              </div>
          </div>
      </div>
      <div class="box-body table-responsive">
          <table class="table table-hover">
              <tbody><tr>
                  <th>{{phrase.ID}}</th>
                  <th>{{phrase.name}}</th>
                  <th>{{phrase.username}}</th>
                  <th>{{phrase.email}}</th>
                  <th>{{phrase.Operations}}</th>
              </tr>
              <tr ng-repeat="admin in admins | filter:searchText">
                  <td>{{admin.id}}</td>
                  <td>{{admin.fullName}}</td>
                  <td>{{admin.username}}</td>
                  <td>{{admin.email}}</td>
                  <td>
                    <a ng-click="edit(admin.id)" type="button" class="btn btn-info btn-flat" title="{{phrase.Edit}}" tooltip><i class="fa fa-pencil"></i></a>
                    <a ng-click="remove(admin,$index)" type="button" class="btn btn-danger btn-flat" title="{{phrase.Remove}}" tooltip><i class="fa fa-trash-o"></i></a>
                  </td>
              </tr>
              <tr ng-show="!admins.length"><td class="noTableData" colspan="5">No administrators</td></tr>
          </tbody></table>
      </div>
  </div>
</section>

<section class="content" ng-show="views.add">
  <a ng-click="changeView('list')" class="floatRTL btn btn-danger btn-flat pull-right marginBottom15">{{phrase.cancelAdd}}</a>
  <div class="box col-xs-12">
    <div class="box-header">
        <h3 class="box-title">{{phrase.addAdministrator}}</h3>
    </div>
    <div class="box-body table-responsive">
      <form class="form-horizontal" name="addAdmin" role="form" ng-submit="saveAdd()" novalidate>
        <div class="form-group" ng-class="{'has-error': addAdmin.fullName.$invalid}">
          <label for="inputEmail3" class="col-sm-2 control-label">{{phrase.FullName}} * </label>
          <div class="col-sm-10">
            <input type="text" name="fullName" ng-model="form.fullName" class="form-control" required placeholder="{{phrase.FullName}}">
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': addAdmin.username.$invalid}">
          <label for="inputPassword3" class="col-sm-2 control-label">{{phrase.username}} *</label>
          <div class="col-sm-10">
            <input type="text" name="username" ng-model="form.username" class="form-control" placeholder="{{phrase.username}}" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': addAdmin.email.$invalid}">
          <label for="inputPassword3" class="col-sm-2 control-label">{{phrase.email}} *</label>
          <div class="col-sm-10">
            <input type="email" name="email" ng-model="form.email" class="form-control" placeholder="{{phrase.email}}" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': addAdmin.password.$invalid}">
          <label for="inputPassword3" class="col-sm-2 control-label">{{phrase.password}} *</label>
          <div class="col-sm-10">
            <input type="password" name="password" ng-model="form.password" class="form-control" placeholder="{{phrase.password}}" required>
          </div>
        </div>
        <div class="form-group">
          <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-default" ng-disabled="addAdmin.$invalid">{{phrase.addAdministrator}}</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</section>

如果你能解释这一切意味着什么,我怎样才能创建这样的代码?

任何帮助将不胜感激

1 个答案:

答案 0 :(得分:5)

在这种情况下,这些是AngularJs表达式。还有其他模板引擎使用大括号{{}},但在你提供的代码中,它的AngularJs。