Tuesday, 16 May 2017

NG2- How to add Javascript in Angular 2

NG2- How to add Javascript in Angular 2
--------------------------------------------------

We shouldn't directly include script in index.html

Solution-1 - Angular CLI- solution
-----------
Open Angular-cli.json 

add under script{ ""ScriptName": "JS file  path located in our application" }

Solution-2 - Other Ng application
-----------

Open the package.json 

add under script{ "ScriptName" :"Script npm path - name" }

No comments:

Post a Comment

KISS, DRY, SOLID, YAGNI — A Simple Guide to Some Principles of Software Engineering and Clean Code

1 — KISS (Keep It Simple, Stupid)  Simplicity triumphs over complexity. Direct and clear codes are better for developing, maintaining, and s...