Giter Club home page Giter Club logo

Comments (4)

Gbuomprisco avatar Gbuomprisco commented on May 29, 2024

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.

Glebby avatar Glebby commented on May 29, 2024

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.

Gbuomprisco avatar Gbuomprisco commented on May 29, 2024

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.

Glebby avatar Glebby commented on May 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.