Look at compiling transcluded content in AngularJS.