【发布时间】:2017-05-11 11:10:19
【问题描述】:
我有三个链接,点击链接后,如何向点击的链接添加一个类?
必须将类添加到单击的父级,即 nav-item start
这是我的代码
var myapp = angular.module('myapp', []);
myapp.controller('FirstCtrl', function($scope)
{
// The class must be added to clicked one's parent that is nav-item start
$scope.callOne = function()
{
alert('one');
}
$scope.callTwo = function()
{
alert('two');
}
$scope.callThree = function()
{
alert('three');
}
});
我的小提琴
http://jsfiddle.net/9fR23/448/
你能告诉我怎么做吗
【问题讨论】:
标签: angularjs