fix(index): display code example corretly
This commit fixes the displaying of the „name“ template variable (see screenshot below) in the code example on the front page. https://goo.gl/qcLf5X
This commit is contained in:
parent
67851e3513
commit
45d136e327
|
@ -11,8 +11,7 @@
|
|||
h3.text-headline Start Quick, Build Fast
|
||||
p.text-body Express your ideas with clean, understandable code. Angular is simple to build on, easy to change, and friendly to the way UX designers work. Create a UI that is beautiful by default, with material design and support for web components. Angular takes <a href="/docs/js/latest/quickstart.html">just minutes to learn</a>.
|
||||
.c6
|
||||
pre.prettyprint.linenums.is-showcase
|
||||
code.
|
||||
code-example(language="javascript" format="linenums" showcase="true").
|
||||
@Component({selector: 'my-app'})
|
||||
@View({template: '<h1>Hi {{ name }}</h1>'})
|
||||
|
||||
|
|
|
@ -11,7 +11,9 @@ angularIO.directive('codeExample', function() {
|
|||
|
||||
compile: function(tElement, attrs) {
|
||||
var html = (attrs.escape === "html") ? _.escape(tElement.html()) : tElement.html();
|
||||
var template = '<pre class="prettyprint ' + attrs.format + ' lang-' + attrs.language + '">' +
|
||||
var classes = 'prettyprint ' + attrs.format + ' lang-' + attrs.language +
|
||||
(attrs.showcase === 'true' ? ' is-showcase' : '');
|
||||
var template = '<pre class="' + classes + '">' +
|
||||
'<code ng-non-bindable>' + html + '</code>' +
|
||||
'</pre>';
|
||||
|
||||
|
|
Loading…
Reference in New Issue