Replacement for View class (in old directory views) in js

(Clément Décou) #1

The directory views doesn’t exist in discourse 1.8 so i don’t find the class TopicView…

There is an example of an old code and i want to replace it :
import TopicView from "discourse/views/topic";


      didInsertElement: function () {
        this._super();'afterRender', this, this.afterRenderEvent);
      afterRenderEvent: function () {
        var is_wordpress = this.get('topic').is_wordpress;
        var creator = this.get('posters.firstObject');
        if (is_wordpress) {


Does the TopicView class still exist in js ?

(Robin Ward) #2

Views have been removed from new versions of Ember.js.

There’s a new component called discourse-topic which should work for your needs.

(Clément Décou) #3

Thank you ! I will try it !

(Robin Ward) closed #4