Giter VIP home page Giter VIP logo

Comments (6)

tinesoft avatar tinesoft commented on June 9, 2024

Hi @snowywolfie ,

Which version of the Angular CLI are you using? (run ng version and post output).
Did you follow steps mentioned in the guide on how to use with CLI?

Also, can you post your tsconfig.json file?

from ngx-scrollreveal.

snowywolfie avatar snowywolfie commented on June 9, 2024

angular-cli: 1.0.0-beta.21
node: 6.9.1
os: darwin x64

Yes, I included scrollreveal.js in scripts.

tsconfig.json
{
"compilerOptions": {
"baseUrl": "",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": ["es6", "dom"],
"mapRoot": "./",
"module": "es6",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
]
}
}

from ngx-scrollreveal.

tinesoft avatar tinesoft commented on June 9, 2024

Ok, i'll have a look tonight, don't have access to my environment right now

from ngx-scrollreveal.

tinesoft avatar tinesoft commented on June 9, 2024

Hi @snowywolfie ,

Regarding the errors you were having while running ng serve,
the good news is that i was able to reproduce the issue locally.

This is due to the TypeScript Compiler (TSC) complaining about missing types definition for ScrollReveal JS. As this library is being used underneath by my ngs-reveal.service.ts, the compiler has added a reference to it in generated definition file ngs-reveal.service.d.ts(1st line). This is the normal behavior of TSC prior to 2.1.
It seems that from v2.1 and later, TSC will no longer complain about missing types definition for a library that doesn't have any (like ScrollReveal JS) provided the package itself is found in node_modules (read Announcing TypeScript 2.1 for more).

So Upgrading your Typescript to 2.1 (tricky!) or Installing typings for scrollreval JS should get you rid of the errors:

npm install @types/scrollreveal --save-dev

I am thinking about a more elegant solution, but until then, that should make the CLI happy again :)

from ngx-scrollreveal.

snowywolfie avatar snowywolfie commented on June 9, 2024

Cool, It works like charm! I use the second method btw.
Thank you for prompt reply and efforts ! 👍

from ngx-scrollreveal.

tinesoft avatar tinesoft commented on June 9, 2024

Neat-o!

Even better, i've tested with current version of Angular CLI (beta-22-1), and there is no need to install the scrollreveal typings anymore, it just works out of the box!
There must have been some changes in the ng build/serve and/or angular customized version of tsc that made this possible.

I will update the docs.

from ngx-scrollreveal.

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.