Join the Stack Overflow Community
Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I have a web site with angularjs framework for front-end using index.html and .net REST API services.

I need to achieve something one of followings:

1. I can create a dummy MVC view and write @Scripts.Render(...) to render all the bundled script and whatever I can see chrome developers tool e.g.

/bundles/angular?v=asIfVCRZ0mozQeQR34C1aw1HwLnnZATyODNO8bNn1mY1 I can take this to index.html and put in a way

<script src="/bundles/angular?v=asIfVCRZ0mozQeQR34C1aw1HwLnnZATyODNO8bNn1mY1"></script>

2. This is possible on my local, however I am not sure, if I publish to another server, there random key asIfVCRZ0mozQeQR34C1aw1HwLnnZATyODNO8bNn1mY1 will remain as is.

So questions here are:

  1. Is there any setting to keep this key unchanged?
  2. OR simply handling bundle & minification feature of angularjs-index.html page? note- I do not want to use any of npm packages
share|improve this question
2  
why not make your home page an MVC view (just Index), rather than a static .html? Then there's no problem. Angular will still work just the same, and the minification will work without you having to hardcode any links – ADyson 19 hours ago
    
I got something equivalent to this need using web Essentials 2012, where I can only bundle & minify my javascripts into a single file and refer that file into index.html. Refer here – Avi Kenjale 17 hours ago
    
if you use MVC and just create one single JS bundle and one single CSS bundle in BundleConfig.cs containing all of your script/style files respectively, you'll get one single bundle download for each type. Is that what you mean? – ADyson 13 hours ago
    
Basically, I am not using MVC, however to get thsi dynamic key from somewhere I use dummy MVC view and @Scripts.Render(...), so from Chrome development tool I can get dynamic key. However need make sure this remains same across multiple environments. – Avi Kenjale 13 hours ago
    
which is why I'm saying why not just actually make your home page an MVC view, instead of messing about making "dummy" views and then trying to re-use the minified scripts elsewhere? I think you're making it more complicated than it needs to be. What's the reason not to use an MVC view for a single page app? – ADyson 12 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.