Skip to content

A little typescript question #209

Closed Answered by arnoson
sqllyw asked this question in Q&A
Discussion options

You must be logged in to vote

You won't get these issues with a normal object:

createApp({ $delimiters: ['${', '}'] }).mount()

If you have to use a class, you have to either use a field initializer

class MyApp {
  $delimiters = ['${', '}']
}

or define the $delimiters field

class MyApp {
  $delimiters: string[]

  constructor() {
    this.$delimiters = ['${', '}']
  }
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sqllyw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants