File tree Expand file tree Collapse file tree 2 files changed +52
-30
lines changed Expand file tree Collapse file tree 2 files changed +52
-30
lines changed Original file line number Diff line number Diff line change 6
6
#end
7
7
8
8
#add-js-interop-file-to-getting-started-client
9
- add the ` telerik-blazor.min. js ` file to your main index file - ` wwwroot/index.html ` :
9
+ add the ` telerik-blazor.js ` file to your main index file - ` wwwroot/index.html ` :
10
10
11
+ **HTML**
12
+
11
13
@[ template] ( /_contentTemplates/common/js-interop-file.md#js-interop-file-snippet )
12
14
15
+ @[ template] ( /_contentTemplates/common/js-interop-file.md#enable-static-assets )
13
16
#end
14
17
15
18
#add-js-interop-file-to-getting-started-server
16
- add the ` telerik-blazor.min. js ` file to your main index file - ` ~/Pages/_Host.cshtml ` :
19
+ add the ` telerik-blazor.js ` file to your main index file - ` ~/Pages/_Host.cshtml ` :
17
20
21
+ **HTML**
22
+
18
23
@[ template] ( /_contentTemplates/common/js-interop-file.md#js-interop-file-snippet )
24
+
25
+ @[ template] ( /_contentTemplates/common/js-interop-file.md#enable-static-assets )
19
26
#end
20
27
21
28
#js-interop-file-snippet
29
+ <head >
30
+ . . .
31
+ <script src =" _content/telerik.ui.for.blazor/js/telerik-blazor.js " defer ></script >
32
+ </head >
33
+ #end
34
+
35
+ #path-to-trial-interop
36
+ If you are using a trial license, the path is ` _content/telerik.ui.for.blazor.trial/js/telerik-blazor.js `
37
+ #end
38
+
39
+ #enable-static-assets
40
+ To enable the use of static assets in your project, make sure you have the following line to your ** Server** project ` Startup.cs ` file:
41
+
42
+ **C#**
43
+
44
+ @[ template] ( /_contentTemplates/common/js-interop-file.md#enable-static-assets-snippet )
45
+
46
+ #end
47
+
48
+ #enable-static-assets-snippet
49
+ namespace MyBlazorAppName
50
+ {
51
+ public class Startup
52
+ {
53
+ public void Configure(IComponentsApplicationBuilder app)
54
+ {
55
+ //more code may be present here
56
+
57
+ //make sure this is present to enable static files from a package
58
+ app.UseStaticFiles();
59
+ }
60
+ }
61
+ }
62
+ #end
63
+
64
+ #js-interop-file-snippet-cdn
22
65
** HTML**
23
66
24
67
<head>
32
75
33
76
#app-paths
34
77
Add the following to your main index file. For a server-side Blazor app it is ` ~/Pages/Index.cshtml ` , and for a client-side Blazor app, it is ` wwwroot/index.html ` .
35
- #
78
+ #end
36
79
Original file line number Diff line number Diff line change @@ -59,41 +59,20 @@ To have the Telerik Blazor components look and behave as expected in the browser
59
59
60
60
* Our JS Interop file. It provides features that cannot be implemented with native Blazor.
61
61
62
- @[ template] ( /_contentTemplates/common/js-interop-file.md#js-interop-file-snippet )
62
+ @[ template] ( /_contentTemplates/common/js-interop-file.md#js-interop-file-snippet-cdn )
63
63
64
64
65
65
### Static Assets
66
66
67
67
You can add the JS Interop file as a static asset from our package, instead of using a CDN.
68
68
69
- To enable the use of static assets in your project, make sure you have the following line to your ** Server** project ` Startup.cs ` file:
70
-
71
- ```` C#
72
- namespace MyBlazorAppName
73
- {
74
- public class Startup
75
- {
76
- public void Configure (IComponentsApplicationBuilder app )
77
- {
78
- // more code may be present here
79
-
80
- // make sure this is present to enable static files from a package
81
- app .UseStaticFiles ();
82
- }
83
- }
84
- }
85
- ````
86
-
87
- Here is the ` script ` tag for our static asset path:
69
+ **HTML**
70
+
71
+ @[ template] ( /_contentTemplates/common/js-interop-file.md#js-interop-file-snippet )
88
72
89
- ```` SHTML
90
- <head>
91
- . . .
92
- <script src="_content/telerik.ui.for.blazor/js/telerik-blazor.js" defer></script>
93
- </head>
94
- ````
73
+ Note that
74
+ @[ template] ( /_contentTemplates/common/js-interop-file.md#enable-static-assets )
95
75
96
- > note If you are using a trial license, the path is ` _content/telerik.ui.for.blazor.trial/js/telerik-blazor.js ` .
97
76
98
77
## Project Configuration
99
78
You can’t perform that action at this time.
0 commit comments