Update controller.js

Write a directive