new controller to clean logic from HTML

using directives to call js methods