Add compile method to compile view