Since you have ng-click anyways, you could also use <button type="button">
, even inside the form tag. The default behaviour of the button element is type="submit"
, which is what you want to prevent. So, no javascript needed at all!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…