typescript-components
A TypeScript Framework for non-pwa pages
Installation
npm install typescript-components --save
Node
;
Why not Angular, React, Vue.js etc?
Have you ever had to develop a project that you could not develop as a singe-page project?
I have encountered this problem many times already. Every time I wanted to use one of the above frameworks, but could not, because these are based on client-side rendering.
This framework is based on simple components, which can be set to an element via data attribute and thus extend this to various functionalities.
Usage
First, the component must be declared. Here we declare a simple "scroll to top" button.
// scroll-top.component.ts; /** * Decorate the declared component class with the @Component decorator (the magic happens here) */
Then we need to register the created component for bootstrapping.
// main.ts;; ComponentFactory.registerComponents;
Now we just have to define the html and call the page (after building the javascript of cause).
<!-- index.html --> TypeScript Components To Top 1000ms
Take a look at the examples if you want to see more advanced component configurations.
A documentation will follow soon to show you all programming possibilities.