Is it possible to create an HTML fragment in an AngularJS controller and have this HTML shown in the view?
This comes from a requirement to turn an
there is one more solution for this problem using creating new attribute or directives in angular.
product-specs.html
Specs
-
Shine
: {{product.shine}}
-
Faces
: {{product.faces}}
-
Rarity
: {{product.rarity}}
-
Color
: {{product.color}}
app.js
(function() {
var app = angular.module('gemStore', []);
app.directive(" ", function() {
return {
restrict: 'E',
templateUrl: "product-specs.html"
};
});
index.html
//it will load product-specs.html file here.
or
//it will add product-specs.html file
or
https://docs.angularjs.org/guide/directive