Closed casper123 closed 9 years ago
I get the following error.
Error: elem.mask is not a function .link@http://localhost:8100/js/directive.js:44:17 invokeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:16019:9 nodeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:15531:1 compositeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14887:13 compositeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14890:13 compositeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14890:13 nodeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:15526:1 compositeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14887:13 compositeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14890:13 compositeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14890:13 nodeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:15526:1 compositeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14887:13 nodeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:15526:1 compositeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14887:13 publicLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14766:30 self.appendViewElement@http://localhost:8100/lib/ionic/js/ionic.bundle.js:47324:5 ionicViewSwitcher.create/switcher.render@http://localhost:8100/lib/ionic/js/ionic.bundle.js:45864:29 ionicViewSwitcher.create/switcher.init@http://localhost:8100/lib/ionic/js/ionic.bundle.js:45784:11 self.render@http://localhost:8100/lib/ionic/js/ionic.bundle.js:47225:5 self.register@http://localhost:8100/lib/ionic/js/ionic.bundle.js:47181:5 updateView@http://localhost:8100/lib/ionic/js/ionic.bundle.js:50834:11 .compile/</<@http://localhost:8100/lib/ionic/js/ionic.bundle.js:50811:11 $RootScopeProvider/this.$get</Scope.prototype.$broadcast@http://localhost:8100/lib/ionic/js/ionic.bundle.js:22496:15 transitionTo/$state.transition<@http://localhost:8100/lib/ionic/js/ionic.bundle.js:39883:11 processQueue@http://localhost:8100/lib/ionic/js/ionic.bundle.js:20962:27 scheduleProcessQueue/<@http://localhost:8100/lib/ionic/js/ionic.bundle.js:20978:27 $RootScopeProvider/this.$get</Scope.prototype.$eval@http://localhost:8100/lib/ionic/js/ionic.bundle.js:22178:16 $RootScopeProvider/this.$get</Scope.prototype.$digest@http://localhost:8100/lib/ionic/js/ionic.bundle.js:21994:15 $RootScopeProvider/this.$get</Scope.prototype.$apply@http://localhost:8100/lib/ionic/js/ionic.bundle.js:22282:13 $LocationProvider/this.$get</<@http://localhost:8100/lib/ionic/js/ionic.bundle.js:19144:13 createEventHandler/eventHandler@http://localhost:8100/lib/ionic/js/ionic.bundle.js:10823:9 triggerMouseEvent@http://localhost:8100/lib/ionic/js/ionic.bundle.js:2811:3 tapClick@http://localhost:8100/lib/ionic/js/ionic.bundle.js:2800:3 tapMouseUp@http://localhost:8100/lib/ionic/js/ionic.bundle.js:2870:5 " "" ionic.bundle.js:19387:17
.directive('mask', function () { return { restrict: 'A', link: function (scope, elem, attr, ctrl) {
if (attr.mask) elem.mask(attr.mask, { placeholder: attr.maskPlaceholder }); } };
})
Is It possible that you haven't added jquery and jquery.maskedinput.min.js? @casper123
I had success by changing it to: $(elem).mask(attr.mask, { placeholder: attr.maskPlaceholder });
I get the following error.
Error: elem.mask is not a function .link@http://localhost:8100/js/directive.js:44:17 invokeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:16019:9 nodeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:15531:1 compositeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14887:13 compositeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14890:13 compositeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14890:13 nodeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:15526:1 compositeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14887:13 compositeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14890:13 compositeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14890:13 nodeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:15526:1 compositeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14887:13 nodeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:15526:1 compositeLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14887:13 publicLinkFn@http://localhost:8100/lib/ionic/js/ionic.bundle.js:14766:30 self.appendViewElement@http://localhost:8100/lib/ionic/js/ionic.bundle.js:47324:5 ionicViewSwitcher.create/switcher.render@http://localhost:8100/lib/ionic/js/ionic.bundle.js:45864:29 ionicViewSwitcher.create/switcher.init@http://localhost:8100/lib/ionic/js/ionic.bundle.js:45784:11 self.render@http://localhost:8100/lib/ionic/js/ionic.bundle.js:47225:5 self.register@http://localhost:8100/lib/ionic/js/ionic.bundle.js:47181:5 updateView@http://localhost:8100/lib/ionic/js/ionic.bundle.js:50834:11 .compile/</<@http://localhost:8100/lib/ionic/js/ionic.bundle.js:50811:11 $RootScopeProvider/this.$get</Scope.prototype.$broadcast@http://localhost:8100/lib/ionic/js/ionic.bundle.js:22496:15 transitionTo/$state.transition<@http://localhost:8100/lib/ionic/js/ionic.bundle.js:39883:11 processQueue@http://localhost:8100/lib/ionic/js/ionic.bundle.js:20962:27 scheduleProcessQueue/<@http://localhost:8100/lib/ionic/js/ionic.bundle.js:20978:27 $RootScopeProvider/this.$get</Scope.prototype.$eval@http://localhost:8100/lib/ionic/js/ionic.bundle.js:22178:16 $RootScopeProvider/this.$get</Scope.prototype.$digest@http://localhost:8100/lib/ionic/js/ionic.bundle.js:21994:15 $RootScopeProvider/this.$get</Scope.prototype.$apply@http://localhost:8100/lib/ionic/js/ionic.bundle.js:22282:13 $LocationProvider/this.$get</<@http://localhost:8100/lib/ionic/js/ionic.bundle.js:19144:13 createEventHandler/eventHandler@http://localhost:8100/lib/ionic/js/ionic.bundle.js:10823:9 triggerMouseEvent@http://localhost:8100/lib/ionic/js/ionic.bundle.js:2811:3 tapClick@http://localhost:8100/lib/ionic/js/ionic.bundle.js:2800:3 tapMouseUp@http://localhost:8100/lib/ionic/js/ionic.bundle.js:2870:5 " "" ionic.bundle.js:19387:17
.directive('mask', function () { return { restrict: 'A', link: function (scope, elem, attr, ctrl) {
})