Commit a4efb55ffc8ab450cb9452f35fede881ea6a2b3c

Authored by Imshann
1 parent cc35f3f0

feat(table): 优化组件

build/Slot/Slot.js
... ... @@ -17,7 +17,6 @@ angular.module("esNgAntd").directive("antdSlot", function ($compile) {
17 17 content: (newValue) => {
18 18 if (newValue !== undefined) {
19 19 if (/<[^>]+>/.test(newValue)) {
20   - console.log(newValue);
21 20 $element.replaceWith(
22 21 $compile(newValue)(
23 22 $scope.context ? $scope.context : $scope
... ...
dist/ng-antd.js
... ... @@ -367,7 +367,7 @@ eval(&quot;__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Sel
367 367 \****************************/
368 368 /***/ (() => {
369 369  
370   -eval("angular.module(\"esNgAntd\").directive(\"antdSlot\", function ($compile) {\n return {\n controllerAs: \"antdSlot\",\n restrict: \"E\",\n transclude: true,\n replace: true,\n scope: {\n content: \"@\",\n context: \"=\",\n },\n controller: function ($scope, $element, $attrs) {\n this.getContext = function () {\n return $scope;\n };\n\n $scope.watch = {\n content: (newValue) => {\n if (newValue !== undefined) {\n if (/<[^>]+>/.test(newValue)) {\n console.log(newValue);\n $element.replaceWith(\n $compile(newValue)(\n $scope.context ? $scope.context : $scope\n )\n );\n } else {\n $element.text(newValue);\n }\n }\n },\n };\n\n for (const key in $scope.watch) {\n $scope.$watch(key, $scope.watch[key], true);\n }\n },\n link: function ($scope, $element, $attrs, $controllers, $transclude) {},\n };\n});\n\n\n//# sourceURL=webpack://ng-antd/./build/Slot/Slot.js?");
  370 +eval("angular.module(\"esNgAntd\").directive(\"antdSlot\", function ($compile) {\n return {\n controllerAs: \"antdSlot\",\n restrict: \"E\",\n transclude: true,\n replace: true,\n scope: {\n content: \"@\",\n context: \"=\",\n },\n controller: function ($scope, $element, $attrs) {\n this.getContext = function () {\n return $scope;\n };\n\n $scope.watch = {\n content: (newValue) => {\n if (newValue !== undefined) {\n if (/<[^>]+>/.test(newValue)) {\n $element.replaceWith(\n $compile(newValue)(\n $scope.context ? $scope.context : $scope\n )\n );\n } else {\n $element.text(newValue);\n }\n }\n },\n };\n\n for (const key in $scope.watch) {\n $scope.$watch(key, $scope.watch[key], true);\n }\n },\n link: function ($scope, $element, $attrs, $controllers, $transclude) {},\n };\n});\n\n\n//# sourceURL=webpack://ng-antd/./build/Slot/Slot.js?");
371 371  
372 372 /***/ }),
373 373  
... ...
example/table/inner-scope.html renamed to example/table/render-scope.html
... ... @@ -3,7 +3,7 @@
3 3  
4 4 <head>
5 5 <meta charset="UTF-8" />
6   - <title></title>
  6 + <title>Render作用域</title>
7 7 </head>
8 8  
9 9 <body style="padding: 50px;">
... ...
src/Slot/Slot.js
... ... @@ -10,7 +10,6 @@ class Slot {
10 10 content: (newValue) => {
11 11 if (newValue !== undefined) {
12 12 if (/<[^>]+>/.test(newValue)) {
13   - console.log(newValue)
14 13 $element.replaceWith(
15 14 $compile(newValue)(
16 15 $scope.context ? $scope.context : $scope
... ...