You need to set "MyController" on the navigator or above the navigator.
<ons-navigator
ng-controller="MyController"
title="MyTitlte"
right-button-icon="fa fa-lg fa-refresh"
on-right-button-click="refresh()"
page="pages/msg.html">
</ons-navigator>