私はAngularjsに入っています。私は、機能を再利用したい、resetForm()
機能です。私の質問は、私はまだ私のコントローラの中に入れて$scope
か、工場やサービスを作るのですか?どこに正規関数を置くのですか?Angularjs
app.controller('testController', [
'$scope',
'testService',
function($scope, testService) {
$scope.addTestForm = function() {
var body = document.getElementsByTagName('body')[0];
if (!body.classList.contains('test__add')) {
body.classList.add('test__add');
}
};
//do I add my function here?
function name() {};
}]);