diff --git a/res/app/components/stf/common-ui/native-autocomplete/index.js b/res/app/components/stf/common-ui/native-autocomplete/index.js new file mode 100644 index 00000000..3f6444d8 --- /dev/null +++ b/res/app/components/stf/common-ui/native-autocomplete/index.js @@ -0,0 +1,6 @@ +require('./native-autocomplete.css') + +module.exports = angular.module('stf.native-autocomplete', [ + +]) + .directive('nativeAutocomplete', require('./native-autocomplete-directive')) diff --git a/res/app/components/stf/common-ui/native-autocomplete/native-autocomplete-directive.js b/res/app/components/stf/common-ui/native-autocomplete/native-autocomplete-directive.js new file mode 100644 index 00000000..57330d6e --- /dev/null +++ b/res/app/components/stf/common-ui/native-autocomplete/native-autocomplete-directive.js @@ -0,0 +1,13 @@ +module.exports = function nativeAutocompleteDirective() { + return { + restrict: 'E', + replace: true, + scope: { + + }, + template: require('./native-autocomplete.jade'), + link: function (scope, element, attrs) { + + } + } +} diff --git a/res/app/components/stf/common-ui/native-autocomplete/native-autocomplete-spec.js b/res/app/components/stf/common-ui/native-autocomplete/native-autocomplete-spec.js new file mode 100644 index 00000000..eb09e888 --- /dev/null +++ b/res/app/components/stf/common-ui/native-autocomplete/native-autocomplete-spec.js @@ -0,0 +1,23 @@ +describe('nativeAutocomplete', function () { + + beforeEach(module('stf.native-autocomplete')); + + var scope, compile; + + beforeEach(inject(function ($rootScope, $compile) { + scope = $rootScope.$new(); + compile = $compile; + })); + + it('should ...', function () { + + /* + To test your directive, you need to create some html that would use your directive, + send that through compile() then compare the results. + + var element = compile('
hi
')(scope); + expect(element.text()).toBe('hello, world'); + */ + + }); +}); \ No newline at end of file diff --git a/res/app/components/stf/common-ui/native-autocomplete/native-autocomplete.css b/res/app/components/stf/common-ui/native-autocomplete/native-autocomplete.css new file mode 100644 index 00000000..7e597249 --- /dev/null +++ b/res/app/components/stf/common-ui/native-autocomplete/native-autocomplete.css @@ -0,0 +1,3 @@ +.stf-native-autocomplete { + +} \ No newline at end of file diff --git a/res/app/components/stf/common-ui/native-autocomplete/native-autocomplete.jade b/res/app/components/stf/common-ui/native-autocomplete/native-autocomplete.jade new file mode 100644 index 00000000..b4c17dbf --- /dev/null +++ b/res/app/components/stf/common-ui/native-autocomplete/native-autocomplete.jade @@ -0,0 +1 @@ +div.stf-native-autocomplete \ No newline at end of file diff --git a/res/app/components/stf/common-ui/native-autocomplete/sample.jade b/res/app/components/stf/common-ui/native-autocomplete/sample.jade new file mode 100644 index 00000000..28b1e2a8 --- /dev/null +++ b/res/app/components/stf/common-ui/native-autocomplete/sample.jade @@ -0,0 +1,7 @@ +input( + type='text', + native-autocomplete, + ng-model='text', + typeahead='["text1", "text2"]', + history='20' +)