Skip to content

v4.9.0

Compare
Choose a tag to compare
@chasenlehara chasenlehara released this 29 Jun 22:24
· 285 commits to master since this release

This release makes it possible to render component instances in a template with the “unescaped” (triple-curly) tags:

import Component from "can-component";
import stache from "can-stache";

const MyGreeting = Component.extend({
  tag: "my-greeting",
  view: "<p>Hello {{subject}}</p>",
  ViewModel: {
    subject: "string"
  }
});

const myGreetingInstance = new MyGreeting({
  viewModel: {
    subject: "friend"
  }
});

const template = stache("<div>{{{componentInstance}}}</div>");

const fragment = template({
  componentInstance: myGreetingInstance
});

fragment; //-> <div><my-greeting><p>Hello friend</p></my-greeting></div>

This release contains the following pull requests:

  • Add support for can.viewInsert #508
  • Add docs for rendering component instances in templates #546
  • Add "use strict" #560