move calc controller to the directive