How to upgrade to 1.8 for view


#1

I have a view object like this

Ember.FlashView = Ember.View.extend({
  contentBinding: 'Ember.flashController.content',
  classNameBindings: ['isNotice', 'isWarning', 'isError'],
  isNoticeBinding: 'content.isNotice',
  isWarningBinding: 'content.isWarning',
  isErrorBinding: 'content.isError',

  /**
   * callback after view has been inserted into the dom
   */
  didInsertElement: function() {
    this.$('#message').hide();
    Ember.flashController.set('view', this);
  },
.......

Before in Ember 1.7, I call this view in application.hbs like this

  {{#view Ember.FlashView id="flash-view"}}
          <div id="message">
            {{view.content.message}}
          </div>
      {{/view}}

but i got warning

DEPRECATION: Resolved the view "Ember.FlashView" on the global context. Pass a view name to be looked up on the container instead, such as {{view "select"}}. http://emberjs.com/guides/deprecations#toc_global-lookup-of-views-since-1-8
        at lookupViewByClassName (http://localhost:3000/assets/ember.js?body=1:6843:15)
        at handlebarsGetView (http://localhost:3000/assets/ember.js?body=1:6891:23)
        at EmberObject.create.helper (http://localhost:3000/assets/ember.js?body=1:9630:19)
        at viewHelper (http://localhost:3000/assets/ember.js?body=1:9880:25)
        at program1 (http://localhost:3000/assets/templates/application.js?body=1:36:25)
        at prog (http://localhost:3000/assets/handlebars.js?body=1:469:14)
        at CoreView.extend.render (http://localhost:3000/assets/ember.js?body=1:42302:20)
        at apply (http://localhost:3000/assets/ember.js?body=1:19676:27)
        at superFunction [as _super] (http://localhost:3000/assets/ember.js?body=1:16106:15) 

How to solve?


#2

@kithokit Did you follow the link printed out with the deprecation message? I explains in detail what is going on.

Ember.FlashView should likely become App.FlashView, and {{view Ember.FlashView become {{view "flash".


#3

thx for reply I did read and try.

but i still got this error.

DEPRECATION: Quoted view names must refer to a view in the container.
        at handlebarsGetView (http://localhost:3000/assets/ember.js?body=1:6886:17)
        at EmberObject.create.helper (http://localhost:3000/assets/ember.js?body=1:9630:19)
        at viewHelper (http://localhost:3000/assets/ember.js?body=1:9880:25)
        at program1 (http://localhost:3000/assets/templates/application.js?body=1:36:25)
        at prog (http://localhost:3000/assets/handlebars.js?body=1:469:14)
        at CoreView.extend.render (http://localhost:3000/assets/ember.js?body=1:42302:20)
        at apply (http://localhost:3000/assets/ember.js?body=1:19676:27)
        at superFunction [as _super] (http://localhost:3000/assets/ember.js?body=1:16106:15)
        at _MetamorphView.extend.render (http://localhost:3000/assets/ember.js?body=1:10486:21) ember.js?body=1:15376
Uncaught Error: Assertion Failed: flash must be a subclass or an instance of Ember.View, not

#4

I am also using the same Ember.FlashView and now trying to upgrade ember to 1.9.1. @kithokit: Were you able to get this working? and how?