Comments (4)
Hi @Glebby!
The files are already compiled in the /dist folder. It's strange the compiler is compiling index.ts. is your tsconfig.json excluding the node_modules folder?
If that doesn't help, I'll try setting up a system.js configuration (as I have never used it with this, only Webpack) and paste here a working configuration. :)
from ngx-chips.
Hi, yes, node_modules are excluded
{
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"module": "commonjs",
"noEmitOnError": true,
"noImplicitAny": false,
"outDir": "../wwwroot/admin/appScripts/",
"removeComments": false,
"inlineSourceMap": true,
"target": "es5",
"moduleResolution": "node"
},
"exclude": [
"node_modules",
"typings",
"typings/globals",
"typings/index",
"typings/index.d.ts"
]
}
I tried different options but ended up with removing index.ts and tweaking defaults in systemjs.config.js
(function (global) {
// map tells the System loader where to look for things
var map = {
'app': "appScripts", // 'dist',
'@angular': "../lib/@angular",
'ng2-tag-input': "../lib/ng2-tag-input",
'rxjs': "../lib/rxjs"
};
// packages tells the System loader how to load when no filename and/or no extension
var packages = {
'app': { main: "main.js", defaultExtension: "js" },
'ng2-tag-input': { main: "index.js", defaultExtension: "js" },
'rxjs': { defaultExtension: "js" },
};
var ngPackageNames = [
"common",
"compiler",
"core",
"forms",
"http",
"platform-browser",
"platform-browser-dynamic",
"router",
"router-deprecated",
"upgrade",
"ng2-tag-input"
];
This way the control is rendered correctly.
However, when I start typing, I get error:
platform-browser.umd.js:937 TypeError: Cannot read property 'state' of undefined
at Ng2DropdownMenu.handleKeypress (ng2-dropdown-menu.ts:106)
at eval (platform-browser.umd.js:1836)
at eval (platform-browser.umd.js:1913)
at ZoneDelegate.invoke (zone.js:332)
at Object.onInvoke (core.umd.js:9245)
at ZoneDelegate.invoke (zone.js:331)
at Zone.runGuarded (zone.js:239)
at NgZoneImpl.runInnerGuarded (core.umd.js:9278)
at NgZone.runGuarded (core.umd.js:9510)
at HTMLBodyElement.outsideHandler (platform-browser.umd.js:1913)BrowserDomAdapter.logError @ platform-browser.umd.js:937
zone.js:269 Uncaught TypeError: Cannot read property 'state' of undefined
My tag is below:
<tag-input name="userRoles" [ngModel]="user.roles"
[onlyFromAutocomplete]="true"
[autocompleteItems]="allRoles"
[autocomplete]="true"
placeholder="add a new team"
secondaryPlaceholder="Start typing to add a team"
(onAdd)="onTeamAdded($event)"
(onRemove)="onTeamRemoved($event)"
></tag-input>
from ngx-chips.
Glad it compiles now! I published a new version (0.2.4) which fixes that issue. It was related to another package. Let me know 👍
from ngx-chips.
It is working now! thank you. However there is another issue now related to case sensitivity. I will post it as another issue to not mix things up.
from ngx-chips.
Related Issues (20)
- Is there any way that I can set value from tagModel used in ngx-chips in angular? HOT 1
- ngx-chips 3.0.0 - angular 13.0.3 errors on build HOT 1
- ngx-chips not working with angular 12 HOT 2
- Error Compiler ngx-chips 3 and angular 13 HOT 2
- FormControl String Value HOT 1
- Improvement to Input Value Type
- allowDupes is case senitive
- Browser refreshes while add a new tag even after adding [appendToBody]= "false"
- Can't import the named export 'ɵɵviewQuery' from non EcmaScript module (only default export is available) HOT 3
- Adding new tags on a new line?
- Cannot find module 'ng2-material-dropdown' from '../../node_modules/ngx-chips/fesm2015/ngx-chips.mjs' HOT 1
- Getting error in ngx-chips dependency of ng2 material dropdown HOT 5
- Wrong imports are used for rxjs operators HOT 3
- Incorrect type of onTextChange event emitter
- Dropdown and onlyFromAutocomplete always add me selected item
- ./node_modules/ngx-chips/fesm2015/ngx-chips.mjs:2540:24-32 - Error: export 'filter' (imported as 'filter$1') - Error HOT 1
- separatorKeyCodes not working for any code except 32
- Which version of ngx-chips works with Angular 10? HOT 1
- onTagEdited is not working correctly while sorting after editing
- Theme not applying to dropdown.
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 ngx-chips.