is there any way to start with angular2 material2 using ES6?
I have tried to find the way but Failed.
Also checked the git repo where found that all code exist for now with TS
so does it mean we can't able to use it with ES6
is there atlernative to overcome it?
Yes, with Angular you can use vanilla JavaScript - either es5 or es6 - your choice. You can also use Typescript or Dart. Many of the tutorials you see use Typescript, because it works so well with Angular, and because the Angular team use it as their default. But you're certainly not tied to having to use that. If you prefer to use vanilla JS you certainly can -- because, remember, it all gets compiled down to JS, regardless of what you use for your coding.
Also, you can use Material2 regardless of what language and language version you're using to code with in your Angular app.
More info here: https://angular.io/docs/js/latest/quickstart.html
And to use Material in your Angular app, see this: https://material.angular.io/guide/getting-started
Related
Im angular developer.
In our front & back exists some magic calculation methods.
Classes same, but when anyone find bug in calculation need to fix it in two different projects.
maybe there is a way to create a generic codebase (maby function) that can be converted to js(or ts) & java and update two libraries based on the two results obtained
You could try to use kotlin.
Kotlin transpiles to JavaScript and also compiles to java bytecode.
However, you can only access kotlin utilities and neither access java or JS/TS types if you want to use the code in both java and ts/js code but you can use the kotlin stdlib.
But if it really is just a calculation, you may not need java/js specific classes/functions.
However, as VLAZ mentioned in the comments, you should consider doing the calculation only once in the backend.
Setting this up in IntelliJ
You can create such a project in IntelliJ by sekecting Kotlin in the New Project Window and using the project template Library.
Make sure you have the targets common, jvm and js. Since you didn't say you would do native stuff, you don't need the native target.
You can then use the kotlin library in both JavaScript (e.g. Angular) and Java projects as a dependency.
From a Java project, you can reference KOTLIN_PROJECT/build/classes/kotlin/jvm/main (this directory contains compiled Java classes).
From a JavaScript (e.g. Angular) project, you can reference KOTLIN_PROJECT/build/js/packages/kotlinToJavaAndJS.
As a proof of concept, I have made this repository on GitHub.
We have an old style application, written in AngularJs and we would like to "import" couple of editors written in ReactJs.
First idea was ngReact, which is also old school (and available on bower :)) but I was not able to reference neither React or our react components.
As those two things are actually not written in same standard, is it even possible to mix them?
Or is there option to downgrade React components to ES5 during the compile & build?
Why don't we modernize angular app?
We are waiting for completely new ReactJs application version and in a meanwhile we are still using our old one. While we are waiting for the new one, we just wanted to grasp some new features in the old gui.
We ended up with rewriting angularjs to the ES6 and now they work together well.
It took couple of days, but I can say that I am more happy now than that we had that odd mixture we initially wanted to have.
Would it be possible to use https://conversejs.org/ in an Angular 2 or 4 application?
Is it possible to import and use JavaScript libraries from a TypeScript app?
This article claims it is possible:
https://www.thepolyglotdeveloper.com/2017/03/javascript-libraries-in-a-typescript-application-revisited/
Yet my front-end developer says it’s impossible.
Can someone verify?
TypeScript is a superset of JavaScript, and the TypeScript transpiler will convert your code into JavaScript during compilation. Therefore, you can write as much pure JavaScript in a TypeScript app and it should transpile to JavaScript with no issues.
Is it possible to import and use JavaScript libraries from a TypeScript app?
Yes, it is possible. You will still need to appropriately declare/import the JavaScript libraries you want to use or else you will get compile errors.
Would it be possible to use https://conversejs.org/ in an Angular 2 or 4 application?
This really depends on the library. The general answer is "Yes, you can use JavaScript libraries/code in a TypeScript app." But you will personally need to read the documentation in order to verify for this particular library.
Is it possible to use React together wit TypeScript in a simple way?
I want to write my components in TypeScript to have type-safety. The few tutorials I've found so far do always need to have babel-loader, ts-loader and webpack running to make it work.
In my tsconfig I can set "jsx" to either ("preserve","react" or "react-native") but I don't see how to go on from there or which one I should use.
At the end I would like to have a jsx-file which I can reference from my cshtml <script src="#Url.Content("~/Scripts/TypeScript/MyComponent.jsx")".
If you want to use the full features of ES6, then the answer is NO. It'll be high time since most of the users upgrade their system so that all ES6/Typescript code runs properly.
I have been asked to work on a project and to use ES6 when coding the JavaScript on the project.
The project also needs to use React.
I've been searching for the answer to the following question on google but I haven't been able for get it answered so I hope I am allowed to ask this question here.
My question is ... If I need to use ES6 and React on this project, does that mean that I cannot use jQuery?
You can use jQuery along with React and ES6. At the end of the day, it's all JavaScript. However, if you structure your code correctly with React components, you should not need to use jQuery selectors to make any changes to the DOM.