我一直在使用角度js,但显然我不知道如何正确使用$ compile thingy,我需要使用我为角度应用程序定义的登录控制器,但我需要在bootbox“动态”生成类似
的HTMLelement = '<div ng-controller = "loginCtrl"><input type="text" ng-model="username"/>';
element += '<input type="text" ng-model="username"/><input type="button" ng-click = "login()" ></div>'
botbox.dialog(element);
然后我有点尝试这样做......
ng.tcts.directive('livesession_bootbox', function($compile){
element = '<div ng-controller = "loginCtrl"><input type="text" ng-model="username"/>';
element += '<input type="text" ng-model="username"/><input type="button" ng-click = "login()" ></div>'
var definition = {
template:element,
restrict:'E',
scope: 'true'
}
return definition;
});
事实是,我不知道如何做这项工作......