diff --git a/build/Card/Card.js b/build/Card/Card.js
index c7603b9..5ef1b9b 100644
--- a/build/Card/Card.js
+++ b/build/Card/Card.js
@@ -1,31 +1,22 @@
-import template from "./Card.html";
import style from "antd/lib/card/style/index.css";
-angular.module("esNgAntd").directive("antdCard", function (esNgAntd) {
- return {
- controllerAs: "antdCard",
- restrict: "E",
- transclude: true,
- replace: true,
- scope: {
- title: "@",
- extra: "@",
- bordered: "@",
- },
- template: template,
- controller: function ($scope, $element, $attrs) {
- this.getContext = function () {
- return $scope;
- };
-
- $scope.state = {
- extra: $scope.extra,
- };
- },
- link: function ($scope, $element, $attrs, $controllers, $transclude) {
- $element[0].removeAttribute("title");
- $element[0].removeAttribute("extra");
- $element[0].removeAttribute("ng-class");
- esNgAntd.createStyle("ant-card", style);
- },
- };
-});
+import template from "./Card.html";
+angular.module("esNgAntd").directive("antdCard", ["esNgAntd", function (esNgAntd) {
+ return {
+ template: template,
+ restrict: "E",
+ replace: true,
+ transclude: true,
+ scope: {
+ title: "@",
+ extra: "@",
+ bordered: "="
+ },
+ link: function ($scope, $element) {
+ $element[0].removeAttribute("title");
+ $element[0].removeAttribute("extra");
+ $element[0].removeAttribute("ng-class");
+ $scope.self = $scope;
+ esNgAntd.createStyle("ant-card", style);
+ }
+ };
+}]);
\ No newline at end of file
diff --git a/build/Slot/Slot.js b/build/Slot/Slot.js
index d82f676..c7e53da 100644
--- a/build/Slot/Slot.js
+++ b/build/Slot/Slot.js
@@ -1,38 +1,29 @@
-angular.module("esNgAntd").directive("antdSlot", function ($compile) {
- return {
- controllerAs: "antdSlot",
- restrict: "E",
- transclude: true,
- replace: true,
- scope: {
- content: "@",
- context: "=",
- },
- controller: function ($scope, $element, $attrs) {
- this.getContext = function () {
- return $scope;
- };
-
- $scope.watch = {
- content: (newValue) => {
- if (newValue !== undefined) {
- if (/<[^>]+>/.test(newValue)) {
- $element.replaceWith(
- $compile(newValue)(
- $scope.context ? $scope.context : $scope
- )
- );
- } else {
- $element.text(newValue);
- }
- }
- },
- };
-
- for (const key in $scope.watch) {
- $scope.$watch(key, $scope.watch[key], true);
+angular.module("esNgAntd").directive("antdSlot", ["$compile", function ($compile) {
+ return {
+ restrict: "E",
+ replace: true,
+ transclude: true,
+ scope: {
+ content: "@",
+ context: "="
+ },
+ controller: function ($scope, $element) {
+ $scope.watch = {
+ content: function (newVal) {
+ if (newVal !== undefined) {
+ if (/<[^>]+>/.test(newVal)) {
+ $element.replaceWith($compile(newVal)($scope.context ? $scope.context : $scope));
+ } else {
+ $element.text(newVal);
}
- },
- link: function ($scope, $element, $attrs, $controllers, $transclude) {},
- };
-});
+ }
+ }
+ };
+ },
+ link: function ($scope) {
+ for (const key in $scope.watch) {
+ $scope.$watch(key, $scope.watch[key], true);
+ }
+ }
+ };
+}]);
\ No newline at end of file
diff --git a/dist/ng-antd.js b/dist/ng-antd.js
index da6a281..ff6d86e 100644
--- a/dist/ng-antd.js
+++ b/dist/ng-antd.js
@@ -49,7 +49,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Bre
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var antd_lib_button_style_index_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/lib/button/style/index.css */ \"./node_modules/antd/lib/button/style/index.css\");\n/* harmony import */ var _Button_html__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Button.html */ \"./build/Button/Button.html\");\n\n\nangular.module(\"esNgAntd\").directive(\"antdButton\", [\"esNgAntd\", function (esNgAntd) {\n return {\n template: _Button_html__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n restrict: \"E\",\n replace: true,\n transclude: true,\n scope: {\n type: \"@\",\n size: \"@\",\n htmlType: \"@\",\n ghost: \"=\",\n loading: \"@\"\n },\n controller: function ($scope) {\n $scope.state = {\n disabled: null,\n className: \"\"\n };\n $scope.watch = {\n loading: newVal => {\n if (newVal !== undefined) {\n if (newVal === \"true\") {\n $scope.state.className += \" ant-btn-loading\";\n } else {\n $scope.state.className = $scope.state.className.replace(\" ant-btn-loading\", \"\");\n }\n }\n }\n };\n },\n link: function ($scope, $element, $attrs, $controllers, $transclude) {\n esNgAntd.createStyle(\"ant-btn\", antd_lib_button_style_index_css__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n let className = [\"ant-btn\"];\n \n console.log($scope);\n\n if ($scope.type) {\n className.push(\"ant-btn-\" + $scope.type);\n }\n\n if ($scope.size && [\"lg\", \"sm\", \"xs\"].includes($scope.size)) {\n className.push(\"ant-btn-\" + $scope.size);\n }\n\n if ($scope.ghost) {\n className.push(\"ant-btn-background-ghost\");\n }\n\n $scope.state.className = className.join(\" \");\n\n if ($scope.htmlType) {\n $element[0].setAttribute(\"type\", $scope.htmlType);\n }\n }\n };\n}]);\n\n//# sourceURL=webpack://ng-antd/./build/Button/Button.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var antd_lib_button_style_index_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/lib/button/style/index.css */ \"./node_modules/antd/lib/button/style/index.css\");\n/* harmony import */ var _Button_html__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Button.html */ \"./build/Button/Button.html\");\n\n\nangular.module(\"esNgAntd\").directive(\"antdButton\", [\"esNgAntd\", function (esNgAntd) {\n return {\n template: _Button_html__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n restrict: \"E\",\n replace: true,\n transclude: true,\n scope: {\n type: \"@\",\n size: \"@\",\n htmlType: \"@\",\n ghost: \"=\",\n loading: \"=\"\n },\n controller: function ($scope) {\n $scope.state = {\n disabled: null,\n className: \"\"\n };\n $scope.watch = {\n loading: newVal => {\n if (newVal !== undefined) {\n if (newVal === \"true\") {\n $scope.state.className += \" ant-btn-loading\";\n } else {\n $scope.state.className = $scope.state.className.replace(\" ant-btn-loading\", \"\");\n }\n }\n }\n };\n },\n link: function ($scope, $element, $attrs, $controllers, $transclude) {\n esNgAntd.createStyle(\"ant-btn\", antd_lib_button_style_index_css__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n let className = [\"ant-btn\"];\n\n if ($scope.type) {\n className.push(\"ant-btn-\" + $scope.type);\n }\n\n if ($scope.size && [\"lg\", \"sm\", \"xs\"].includes($scope.size)) {\n className.push(\"ant-btn-\" + $scope.size);\n }\n\n if ($scope.ghost) {\n className.push(\"ant-btn-background-ghost\");\n }\n\n $scope.state.className = className.join(\" \");\n\n if ($scope.htmlType) {\n $element[0].setAttribute(\"type\", $scope.htmlType);\n }\n }\n };\n}]);\n\n//# sourceURL=webpack://ng-antd/./build/Button/Button.js?");
/***/ }),
@@ -60,7 +60,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var antd
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Card_html__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Card.html */ \"./build/Card/Card.html\");\n/* harmony import */ var antd_lib_card_style_index_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/lib/card/style/index.css */ \"./node_modules/antd/lib/card/style/index.css\");\n\n\nangular.module(\"esNgAntd\").directive(\"antdCard\", function (esNgAntd) {\n return {\n controllerAs: \"antdCard\",\n restrict: \"E\",\n transclude: true,\n replace: true,\n scope: {\n title: \"@\",\n extra: \"@\",\n bordered: \"@\",\n },\n template: _Card_html__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n controller: function ($scope, $element, $attrs) {\n this.getContext = function () {\n return $scope;\n };\n\n $scope.state = {\n extra: $scope.extra,\n };\n },\n link: function ($scope, $element, $attrs, $controllers, $transclude) {\n $element[0].removeAttribute(\"title\");\n $element[0].removeAttribute(\"extra\");\n $element[0].removeAttribute(\"ng-class\");\n esNgAntd.createStyle(\"ant-card\", antd_lib_card_style_index_css__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n },\n };\n});\n\n\n//# sourceURL=webpack://ng-antd/./build/Card/Card.js?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var antd_lib_card_style_index_css__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! antd/lib/card/style/index.css */ \"./node_modules/antd/lib/card/style/index.css\");\n/* harmony import */ var _Card_html__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Card.html */ \"./build/Card/Card.html\");\n\n\nangular.module(\"esNgAntd\").directive(\"antdCard\", [\"esNgAntd\", function (esNgAntd) {\n return {\n template: _Card_html__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n restrict: \"E\",\n replace: true,\n transclude: true,\n scope: {\n title: \"@\",\n extra: \"@\",\n bordered: \"=\"\n },\n link: function ($scope, $element) {\n $element[0].removeAttribute(\"title\");\n $element[0].removeAttribute(\"extra\");\n $element[0].removeAttribute(\"ng-class\");\n $scope.self = $scope;\n esNgAntd.createStyle(\"ant-card\", antd_lib_card_style_index_css__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n }\n };\n}]);\n\n//# sourceURL=webpack://ng-antd/./build/Card/Card.js?");
/***/ }),
@@ -367,7 +367,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Sel
\****************************/
/***/ (() => {
-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?");
+eval("angular.module(\"esNgAntd\").directive(\"antdSlot\", [\"$compile\", function ($compile) {\n return {\n restrict: \"E\",\n replace: true,\n transclude: true,\n scope: {\n content: \"@\",\n context: \"=\"\n },\n controller: function ($scope, $element) {\n $scope.watch = {\n content: function (newVal) {\n if (newVal !== undefined) {\n if (/<[^>]+>/.test(newVal)) {\n $element.replaceWith($compile(newVal)($scope.context ? $scope.context : $scope));\n } else {\n $element.text(newVal);\n }\n }\n }\n };\n },\n link: function ($scope) {\n for (const key in $scope.watch) {\n $scope.$watch(key, $scope.watch[key], true);\n }\n }\n };\n}]);\n\n//# sourceURL=webpack://ng-antd/./build/Slot/Slot.js?");
/***/ }),
@@ -9474,7 +9474,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
-eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n// Module\nvar code = \"
\";\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (code);\n\n//# sourceURL=webpack://ng-antd/./build/Card/Card.html?");
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n// Module\nvar code = \"
\";\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (code);\n\n//# sourceURL=webpack://ng-antd/./build/Card/Card.html?");
/***/ }),
diff --git a/example/button.html b/example/button.html
index cb9ec10..9db24e9 100644
--- a/example/button.html
+++ b/example/button.html
@@ -24,7 +24,7 @@
Ghost
Link
Loading
-
Click me
+
Click me