Yes, it is definitely possible. If you are using angular-cli, you first need to access the webpack.config.js file. You can do this by typing
$ ng eject
This will display the configuration file that you need to modify. Please note that after that you will need to start your server with "npm start" instead of "ng serve".
For haml you can use haml-haml-loader
npm install haml-haml-loader
Then, in accordance with the rules of your module in the webpack.config.js file , add the following rule:
module: { rules: [ ... { test: /\.haml$/, loaders: ['haml-haml-loader'] }, ...
Finally, modify your component to use the "haml" file as follows:
@Component({ selector: 'app', template: require('./app.component.haml'), styleUrls: ['./app.component.sass'], })
Alternatively you can use
templateUrl: './app.component.haml',
This should make you work with haml
source share