Do you want to have your classes set by logic? If not you don't need to set the class in ng-class, you should just use the regular HTML class attribute.
If you don't want to add ids by hand (or through an ng-repeat) you can do it like this:
angular.module('myApp', [
])
.controller('editcontroller', function ($scope) {
$scope.menuItems = angular.element(document.querySelectorAll('.testclass'));
$scope.menuclick = function menuclick(e) {
angular.forEach($scope.menuItems, function(el){
angular.element(el).removeClass('active');
});
angular.element(event.target).addClass('active');
};
});
If you do end up creating the <li>
s via a ng-repeat you'll be able to pass in a index property which you can use to set ids How to set repeated element id in AngularJS?.