question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] How to get value of "traits"?

See original GitHub issue

My code:

model: defaultModel.extend({
      init() {
        this.listenTo(this, 'change:url', this.doStuff);
      },

      doStuff() {
        console.log("change");
        console.log(this.model.value);
      },

Thanks!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Geczycommented, Jan 22, 2018

And if you don’t have selected component context, here’s how I get all values of a type:

window.grapesjs.editors[0]
  .getComponents()
  .models.filter(_ => _.attributes.type === 'facebook-messenger')
  .forEach(_ => {
    console.log(
      _.get('traits')
        .where({
          name: 'campaign',
        })[0]
        .get('value')
    )
  })
2reactions
artfcommented, Oct 4, 2017

@HarshOB just like above

componentModel.get('traits').where({name: 'TRAIT-NAME'})[0].get('value')
Read more comments on GitHub >

github_iconTop Results From Across the Web

How Trait Values Are Determined | Hire Success®
Hire Success uses trait values to give you insight into an applicant's personality, so it's important to know exactly how they work.
Read more >
Character Trait Questions for Higher Order Thinking
Comprehension · Based on his character traits, explain why the character acted the way he did. · What other stories/books have we read...
Read more >
Revealing Personality Questions To Ask Others - Glassdoor
Understand what personality questions are, learn when and why to ask them, and see a list of examples to help you get to...
Read more >
1 Question Is All You Need to Judge Someone's Personality
This research-backed shortcut can give you an instant sense of someone's character.
Read more >
Values Interview Questions: What They Are and How To Answer
Interviews are an opportunity for you to describe the skills, education, experience and personality traits that make you a good match for an ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found