Angular 14….Standalone… Component, directive and pipe..New Roadmap

Yes ,,, In 14 version angular given option to work as standalone now no need to use module…its really new journey and game changer for angular roadmap.

So for converting existing component

you need to put standalone true.

@Component({

standalone:true,

selector: ‘app-coins’,

imports:[CommonModule],

providers:[],

templateUrl: ‘./coins.component.html’,

styleUrls: [‘./coins.component.scss’]

})

It will work without part of any module,

But along with it you need to provide dependent module or component, pipe, directive inject in imports,

and services in providers

Routing

Now in routing also have option to lazy load standalone component

{

path:’lazycomponent’,

loadComponent: ()=> import(‘./coins/coins.component’).then(mod=> mod.CoinsComponent)

}

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
ACHARYA ANIL SURYAVANSHI

Software Engineer | Bharat Swabhiman Patanjali Social Activist | Speaker | Motivator | Yoga Trainer