I am looking for best practice for the angular 1 approach and CMS.
I plan to create several shortcut templates, and I want this project to be component, very reusable and managed by CMS content.
I plan to use JSON as a component tree and just compile the tree step by step using $ compile service as follows:
angular.module('app.compile', [], function($compileProvider) { $compileProvider.directive('compile', function($compile) { return function(scope, element, attrs) { scope.$watch( function(scope) {
http://plnkr.co/edit/MwUjE9l6U5wMkE89kwqY?p=preview
- I would like to know someone has already tried this before and can share their reviews.
- Does this sound like a good solution? Is this the best practice?
- Could this method to use the
$compile
service be bad for performance?
source share