Can I install Angular Material library without Bower or NPM?
11,396
You can either use the CDN link in your reference, as explained in the docs, or download the source from CDN.
excerpt from the docs:
<head>
<!-- Angular Material CSS using GitCDN to load directly from `bower-material/master` -->
<link rel="stylesheet" href="https://gitcdn.xyz/repo/angular/bower-material/master/angular-material.css">
</head>
<body>
<!-- Angular Material Dependencies -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-animate.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular-aria.js"></script>
<!-- Angular Material Javascript using GitCDN to load directly from `bower-material/master` -->
<script src="https://gitcdn.xyz/repo/angular/bower-material/master/angular-material.js"></script>
</body>
Or grab the Source
Author by
NZJames
Updated on June 21, 2022Comments
-
NZJames almost 2 years
I want to install the Angular Material library in a project, but I am behind a corporate firewall and even configuring the proxy doesn't work, it seems the proxy blocks certain types of files. Is there a way to install this offline?
FYI this is my BundleConfig
bundles.Add(new StyleBundle("~/Content/css").Include( "~/Content/bootstrap.css", "~/Content/font-awesome.min.css", "~/Scripts/angular-loading/loading-bar.css", "~/Scripts/nya-bs-select/nya-bs-select.min.css", "~/Content/angular-ui-switch.css", "~/Content/site.css")); bundles.Add(new ScriptBundle("~/bundles/angular") .Include("~/Scripts/angular.js", "~/Scripts/angular-route.js", "~/Scripts/angular-ui/ui-bootstrap-tpls.js", "~/Scripts/AngularApp/app.js") .IncludeDirectory("~/app", "*.js", true) .Include("~/Scripts/smart-table/smart-table.js", "~/Scripts/angular-loading/loading-bar.js", "~/Scripts/nya-bs-select/nya-bs-select.min.js", "~/Scripts/moment.js"));
-
NZJames over 8 yearsI tried the CDN link but for some reason was getting JS errors. I'm fairly new to angular so getting dependencies is still giving me difficulties. If I just want to include the JS files in my project, do I need all 4 .js files you mentioned above and the .css file downloaded in my local project?
-
NZJames over 8 yearsJust added my bundleconfigs above. Do I download the 5 above files, put them in my project and then add them to the CSS and JS bundles.add(...) lines above?
-
Patrick over 8 years@NZJames: You can do that, or just copy the lines as they are. It depends on whether or not you want to bundle them. You can create a new bundle as well if you'd like, there's no requirement to do it.
-
Garret Wilson about 7 yearsI'm still not understanding. What link would I use to download
angular-material.min.js
for version 1.1.3? -
Patrick about 7 years@GarretWilson Today it's probably easier to use yarn or npm to download everything and then use a bundler when you publish your site.
-
Garret Wilson about 7 years@Patrick Perhaps. Or perhaps not. Maybe it doesn't work with the JAR-based configuration we're using. Or maybe we haven't had time to migrate to that. Whatever the case, without detracting from your advice, it remains that they should simply provide a link for those who need to download a certain version.