0

実際にangular、ui-router、mdlでアプリを作っているのですが、ビューを変えると入力プレースホルダーが動かなくなりました。

これが私のログインページのコードです(翡翠で)

.mdl-card.mdl-shadow--2dp
  form(name="loginForm" ng-submit="doLogin(loginForm)" novalidate)
    .mdl-card__title.mdl-card--expand
      h2.mdl-card__title-text(translate="authentication.login.title")
    .mdl-card__supporting-text
      .mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label(ng-class="getClass(loginForm.email)")
        input.mdl-textfield__input(
          type="email"
          name="email"
          ng-model="login.email"
          required
        )
        label.mdl-textfield__label(translate="account.email")
        span.mdl-textfield__error(
          ng-repeat="(key, value) in loginForm.email.$error"
          translate="authentication.error.email.{{ key }}"
        )
      .mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label(ng-class="getClass(loginForm.email)")
        input.mdl-textfield__input(
          type="password"
          name="password"
          ng-model="login.password"
          required
        )
        label.mdl-textfield__label(translate="account.password")
        span.mdl-textfield__error(
          ng-repeat="(key, value) in loginForm.password.$error"
          translate="authentication.error.password.{{ key }}"
        )
      .mdl-typography--text-center
        button.mdl-button.mdl-js-button.mdl-button--raised.mdl-js-ripple-effect(
          type="submit"
          ng-disabled="loginForm.$invalid"
          translate="authentication.login.button"
        )
      .mdl-typography--text-center
        button.mdl-button.mdl-js-button.mdl-js-ripple-effect(
          ui-sref="authentication-register"
          translate="authentication.register.title"
        )
        button.mdl-button.mdl-js-button.mdl-js-ripple-effect(
          ui-sref="authentication-request-password"
          translate="authentication.requestPassword.title"
        )

何か考えはありますか?

4

2 に答える 2

0

あなたが提供したコードにプレースホルダー属性がありません。プレースホルダー属性を含む更新されたコードは次のとおりです。

.mdl-card.mdl-shadow--2dp
  form(name="loginForm" ng-submit="doLogin(loginForm)" novalidate)
    .mdl-card__title.mdl-card--expand
      h2.mdl-card__title-text(translate="authentication.login.title")
    .mdl-card__supporting-text
      .mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label(ng-class="getClass(loginForm.email)")
        input.mdl-textfield__input(
          type="email"
          name="email"
          ng-model="login.email"
          required
          placeholder="email"
        )
        label.mdl-textfield__label(translate="account.email")
        span.mdl-textfield__error(
          ng-repeat="(key, value) in loginForm.email.$error"
          translate="authentication.error.email.{{ key }}"
        )
      .mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label(ng-class="getClass(loginForm.email)")
        input.mdl-textfield__input(
          type="password"
          name="password"
          ng-model="login.password"
          required
          placeholder="password"
        )
        label.mdl-textfield__label(translate="account.password")
        span.mdl-textfield__error(
          ng-repeat="(key, value) in loginForm.password.$error"
          translate="authentication.error.password.{{ key }}"
        )
      .mdl-typography--text-center
        button.mdl-button.mdl-js-button.mdl-button--raised.mdl-js-ripple-effect(
          type="submit"
          ng-disabled="loginForm.$invalid"
          translate="authentication.login.button"
        )
      .mdl-typography--text-center
        button.mdl-button.mdl-js-button.mdl-js-ripple-effect(
          ui-sref="authentication-register"
          translate="authentication.register.title"
        )
        button.mdl-button.mdl-js-button.mdl-js-ripple-effect(
          ui-sref="authentication-request-password"
          translate="authentication.requestPassword.title"
        )
于 2015-07-08T17:15:15.700 に答える