'AngularJS page to tag less HTML
I'm working on a python reporting system and I would like to insert some report html code in an markdown file. The individual report are using angular js (see code below) but markdown only support html(cannot add some angular code). I was wondering if it would be possible to render the page in html code where the angular tags are not present and with no javascript. That mean if I open the page in Chrome and I "View Page Source" I will something like the following(static html code).:
<dd class="wrap">[email protected]</dd>
Instead of
<dd class="wrap">{{content.contactEmail || "-"}}</dd>
Here is the source code for the report:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.11/angular.min.js"></script>
<link rel="stylesheet" href="theme_thehive.css" />
</head>
<body ng-app="report" ng-controller="tableController" >
<div class="report-SecurityTrails" ng-if="success">
<div class="panel panel-info">
<div class="panel-heading">
SecurityTrails Whois report ({{content.domain}})
</div>
<div class="panel-body">
<div ng-if="content.contacts.length === 0">
No records found
</div>
<div ng-if="content.contacts.length !== 0">
<dl class=" dl-horizontal">
<dt>Domain: </dt>
<dd class="wrap">{{content.domain|| "-"}}</dd>
</dl>
<dl class="dl-horizontal">
<dt>Contact email: </dt>
<dd class="wrap">{{content.contactEmail || "-"}}</dd>
</dl>
<dl class="dl-horizontal">
<dt>Nameservers: </dt>
<dd class="wrap" ng-repeat="ns in content.nameServers">{{ns}}</dd>
</dl>
<dl class="dl-horizontal">
<dt>Created date: </dt>
<dd class="wrap">{{content.createdDate | date:'yyyy-MM-dd'}}</dd>
</dl>
<dl class="dl-horizontal">
<dt>Updated date: </dt>
<dd class="wrap">{{content.updatedDate | date:'yyyy-MM-dd'}}</dd>
</dl>
<dl class="dl-horizontal">
<dt>Expires date: </dt>
<dd class="wrap">{{content.expiresDate | date:'yyyy-MM-dd'}}</dd>
</dl>
<dl class="dl-horizontal">
<dt>Registrar name: </dt>
<dd class="wrap">{{content.registrarName}}</dd>
</dl>
</div>
</div>
</div>
<div class="panel panel-info" ng-if="success">
<div class="panel-heading">
<strong>Contacts info</strong>
</div>
<div class="panel-body">
<div ng-if="content.contacts.length === 0">
No records found
</div>
<div ng-repeat="contact in content.contacts">
<dl class="dl-horizontal" ng-repeat="(key, value) in contact">
<dt>{{key}}</dt>
<dd>{{value}}</dd>
</dl>
<hr>
</div>
</div>
</div>
</div>
<!-- General error -->
<div class="panel panel-danger" ng-if="!success">
<div class="panel-heading">
<strong>{{artifact.data | fang}}</strong>
</div>
<div class="panel-body">
<dl class="dl-horizontal" ng-if="content.errorMessage">
<dt>
<i class="fa fa-warning"></i></dt>
<dd class="wrap">{{content.errorMessage}}</dd>
</dl>
</div>
</div>
<script type="text/javascript">
var app = angular.module('report', []);
app.controller('tableController', ['$scope', function($scope) {
$scope.success = true
$scope.content =
{
"updatedDate": null,
"status": null,
"registrarName": "Name: One.com A/S\nRegistrar Registrar Website: http://www.test.com",
"private_registration": true,
"nameServers": [
"ns02.one.com",
"ns01.one.com"
],
"expiresDate": null,
"endpoint": "/v1/domain/test.com/whois",
"domain": "test.com",
"createdDate": null,
"contacts": [
{
"type": "technicalContact",
"organization_count": 207907,
"organization": "test.com A/S",
"email_count": 491587,
"email": "[email protected]"
},
{
"type": "registrant",
"name_count": 47404,
"name": "NOT DISCLOSED!"
}
],
"contactEmail": null
}
}]);
</script>
</body>
</html
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
