将指令从Angular1转换为Angular2

时间:2016-04-05 01:18:46

标签: angularjs angularjs-directive angular

我正在尝试从angular1迁移到angular2(在Javascript上),我将如何在Angular2中编写它?我非常困惑

谢谢

module.directive('asiPath', function($compile) {
  return function(scope, element, attrs) {
    scope.$watch(
        function(scope) { return scope.$eval(attrs.asiPath); },
        function(value) { asimon.template.load(element, attrs, scope); }
    );
  };
});

0 个答案:

没有答案