Created
June 25, 2019 14:29
-
-
Save merkle-sitecore-gists/88466b1db25669337cdb703fd5178eb6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Model for parent.hbs | |
public class ParentComponentModel { | |
public string Text { get; set; } | |
public string Modifier { get; set; } = "parent-default"; | |
public SubcomponentModel Subcomponent { get; set; } | |
} | |
// Model for subcomponent.hbs | |
public class SubcomponentModel { | |
public string Content { get; set; } | |
public string Decorator { get; set; } = "subcomponent-default"; | |
} | |
// Controller Index() method | |
public ActionResult Index() { | |
return View("parent", new ParentComponentModel { | |
Text = "Parent", | |
Subcomponent = new SubcomponentModel { | |
Content = "Subcomponent" | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment