#Intellisense for templates, UI components, HTML, and CSS

7 messages · Page 1 of 1 (latest)

devout parrot
#

Hello,
I'm a React/Next.js developer who wants to try out Angular, and I'm used to using UI components like shadcn along with Tailwind. However, the closest alternative for Angular is Spartan UI, which aside from lacking many of the features of shadcn, it looks promising nonetheless.

From how I'm understanding Angular, the html is passed as a template string or url in the Component decorator as follows:

@Component({
  selector: 'app-root',
  styleUrl: './app.component.css',
  template: `<div class="bg-red-100">Hello</div>`
})

However, unlike JSX, it seems that there is no intellisense for writing the HTML or tailwind classes. I tried the following VS extension for Angular, but it doesn't seem to help with writing HTML: https://marketplace.visualstudio.com/items?itemName=TypeScriptTeam.AngularLanguageService2022. This is a huge problem for developer experience, since although I would like to use Spartan UI to develop my application I don't want to sacrifice intellisense. I am aware that I could type my HTML string in a separate HTML file and use a templateURL, but apparently that prevents me from using components like the following (taken from the Spartan UI documentation here: https://www.spartan.ng/documentation/typography):

import { Component } from '@angular/core';
import { hlmH1 } from '@spartan-ng/typography-helm';

@Component({
  selector: 'spartan-h1',
  standalone: true,
  //this template string would be prone to errors for large components and without intellisense
  template: `
    <h1 class="${hlmH1}">The Joke Tax Chronicles</h1>
  `,
})
export default class H1Component {}

I would appreciate any help

SPARTAN

Styles for headings, paragraphs, lists... etc.

slender sluice
devout parrot
#

I am using visual studio, not VScode

#

I can switch, but I don't know how the .net template would work in vscode

slender sluice
#

I know that for .net there is a pretty good extension in VS Code, let me look it up