Comments (7)
I don't use TypeScript, also I don't know how does it resolve dependencies. In node.js, require("custom-input")
returns an object exported by custome-input/index.js
. If you need the Angular module, you have to require("custom-input/build/custom-input")
.
There is also a custom-input/dist/custom-input.js
, which can be used in the browser.
from angular-datetime.
Its just like es6, you use imports at the top of your module.
from angular-datetime.
Then, does import "custom-input/build/custom-input"
work?
from angular-datetime.
I did try adding
import 'custom-input';
which is a valid import for the package but that didn't resolve.
Also since custom-input is a dependency of your module and already included, I find it hard to believe that I have to import it myself.
I am a bit puzzled.
from angular-datetime.
A "valid import" doesn't means that it will do anything to AngularJS. To make a module work with AngularJS, you have to register a module with angular.module()
likes your
angular.module( 'prospaDynamicForm.components', ...
custom-input
itself is not a AngularJS module, which means:
- It can work without Angular
- It does nothing to Angular
So what you are going to do is, to register a Angular module for it:
import customInput from 'custom-input';
angular
.module('custom-input', [])
.factory('customInput', () => customInput);
And that is what custom-input/build/custom-input.js
do.
from angular-datetime.
When you say
custom-input is a dependency of your module and already included
Which may represent 2 things:
-
custom-input
is inside the dependency list in package.jsonIf it is inside package.json, it just tells npm that "Please download
custom-input
after downloadingangular-datetime-input
, becauseangular-datetime-input
needs it". Still, it does nothing to Angular. -
custom-input
is inside the dependency list in angular-datetime-input's angular moduleWhat it does is to tell Angular: "I need to use
custom-input
, you should initiate it first for me". But unless you have registered acustom-input
module, Angular will just tell you that 'custom-input' is not in its registry.
from angular-datetime.
src: dist/datetime.js
angular.module("datetime", ["custom-input"]);
aren't you adding it yourself to your own module? So why would I have to add it if I install your module and add this as a dependency?
Isn't it the whole deal with modules that they are little sell sufficient shells with their own dependencies?
Anyway, if it is something we need to do because your module requires it, please add it to the readme file?
Cheers
from angular-datetime.
Related Issues (20)
- Placeholder HOT 2
- TypeError: date.getTime is not a function HOT 2
- Cursor jumps to end of input field on up/down keys HOT 12
- Compatibility with Angular UI Bootstrap DatePicker Popup HOT 2
- Error parsing (w3c formatted) datetimes having timezone different than the datetime parser one HOT 7
- Object.values HOT 2
- Placeholder isn't actually a placeholder and no way to turn it off HOT 3
- Bug: set day HOT 8
- how can I reset placeholder HOT 1
- Any Way To Use Timezone Strings (UTC, EST)? HOT 1
- Unused property Element.handler HOT 1
- strictdi error on version 5.1.3 HOT 1
- Add bower support. HOT 1
- Incorrect Year when using shortDate format HOT 1
- it is no going through steps, it is just stay in days HOT 3
- IE 11 not supported HOT 4
- Create a new version for angular 2+ HOT 5
- Can't initialize control with anything but current date HOT 6
- Timestamp HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-datetime.