8000 fix(index): display code example corretly · rusongyu/angular.io@45d136e · GitHub
[go: up one dir, main page]

Skip to content

Commit 45d136e

Browse files
jacobmllr95alexeagle
authored andcommitted
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
1 parent 67851e3 commit 45d136e

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

public/index.jade

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.grid-fluid.l-space-bottom-8
22
.c7
3-
h3.text-headline Build Incredible Applications
3+
h3.text-headline Build Incredible Applications
44
p.text-body Angular is a development platform for creating applications using modern web standards. Angular includes a <a href="/features.html">wealth of essential features</a> such as mobile gestures, animations, filtering, routing, data binding, security, internationalization, and beautiful UI components. It's extremely modular, lightweight, and easy to learn.
55
.c5.text-center
66
img(src="/resources/images/logos/html5/html5.png" alt="Modern Web Standards")
@@ -11,17 +11,16 @@
1111
h3.text-headline Start Quick, Build Fast
1212
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>.
1313
.c6
14-
pre.prettyprint.linenums.is-showcase
15-
code.
16-
@Component({selector: 'my-app'})
17-
@View({template: '&lt;h1&gt;Hi {{ name }}&lt;/h1&gt;'})
14+
code-example(language="javascript" format="linenums" showcase="true").
15+
@Component({selector: 'my-app'})
16+
@View({template: '&lt;h1&gt;Hi {{ name }}&lt;/h1&gt;'})
1817

19-
// Component controller
20-
class MyAppComponent {
21-
constructor() {
22-
this.name = 'Ali';
23-
}
18+
// Component controller
19+
class MyAppComponent {
20+
constructor() {
21+
this.name = 'Ali';
2422
}
23+
}
2524

2625
.grid-fluid.l-space-bottom-8
2726
.c7

public/resources/js/directives/code-example.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ angularIO.directive('codeExample', function() {
1111

1212
compile: function(tElement, attrs) {
1313
var html = (attrs.escape === "html") ? _.escape(tElement.html()) : tElement.html();
14-
var template = '<pre class="prettyprint ' + attrs.format + ' lang-' + attrs.language + '">' +
14+
var classes = 'prettyprint ' + attrs.format + ' lang-' + attrs.language +
15+
(attrs.showcase === 'true' ? ' is-showcase' : '');
16+
var template = '<pre class="' + classes + '">' +
1517
'<code ng-non-bindable>' + html + '</code>' +
1618
'</pre>';
1719

0 commit comments

Comments
 (0)
0