【发布时间】:2014-07-28 07:29:47
【问题描述】:
我有一个带有 ng-click 功能的按钮。当我单击按钮时,它应该显示使用自定义指令在 templateUrl 中编码的表单。
我应该使用哪个函数来换屏?
Plunker:http://plnkr.co/edit/oxyOJ0XFDlZsLsnCegsI?p=preview
carVarApp.directive('dataEntry', function() {
return {
restrict: 'E',
controller : function($scope)
{
$scope.onClickEntry = function () {
$scope.formModel = {};
};
},
templateUrl: 'dataEntry.html'
};
【问题讨论】:
标签: angularjs angularjs-directive angularjs-scope angularjs-routing angularjs-ng-click