Main view functionality using directives