离子框架 – 标签内部的ng-click不起作用

前端之家收集整理的这篇文章主要介绍了离子框架 – 标签内部的ng-click不起作用前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
<ion-view>
	<div class="bar bar-header bar-dark">
		<h1 class="title">Welcome</h1>
	</div>
	<ion-content class="has-header">
		<form ng-submit="doLogin()">
			<div class="list">
				<label class="item item-input">
					<span class="input-label">手机号</span>
					<input type="text" ng-model="phonenumber" placeholder="这里输入手机号" maxlength="11">
					<button class="button button-dark" style="margin-right: 16px;" ng-click="getVerifyCode(111)">获取验证码</button>
				</label>
				<label class="item item-input">
					<span class="input-label">验证码</span>
					<input type="password" ng-model="verifycode">
				</label>
				<label class="item">
					<button class="button button-block button-dark" ng-click="getVerifyCode(111)">登 陆</button>
				</label>
			</div>
		</form>
	</ion-content>
</ion-view>

>为什么标签标签内的按钮(获取验证码)不起作用?
>但是标签外的按钮(登陆)工作正常,为什么?
>请帮我解决这个问题.我需要在点击时做出回复
按钮(获取验证码)

working demo

解决方案就是不要为物品使用标签.而只是使用div

HTML

<form ng-submit="doLogin()">
        <div class="list">
            <div class="item item-input">
                <span class="input-label">手机号</span>
                <input type="text" ng-model="phonenumber" placeholder="这里输入手机号" maxlength="11">
                <!-- <input ></input> -->
                <button class="button button-dark" style="margin-right: 16px;" ng-click="getVerifyCode(111)">获取验证码</button>
            </div>
            <label class="item item-input">
                <span class="input-label">验证码</span>
                <input type="password" ng-model="verifycode">
            </label>
            <label class="item">
                <button class="button button-block button-dark" ng-click="getVerifyCode(111)">登 陆</button>
            </label>
        </div>
</form>
原文链接:https://www.f2er.com/angularjs/141564.html

猜你在找的Angularjs相关文章