Use any Js Plugin in Umbraco 7.5 - asp.net-mvc

I'm new to umbraco, and just used a very limited range of Js functions and plugins on that.
So now I need to use some plugin like http://maplacejs.com/ for one of my document types . But it seems doesnt work.
My question is : is it possible to use any js plugin we normally using in HTML , MVC in Umbraco ?
Is there any difference there?

Related

Angular 4 ng-controllers

I am building an Asp.net website with Angular 4 and bootstrap. Being a .net developer, I would like to have all the html in the .cshtml files. Earlier I have used Angular 1.0 version and we use the ng-controller and all the services call will be made from there. Trying to find documentation on using controllers but couldn't find any? Do we have ng-controllers in Angular 4? If not whats the best alternative. Also I dont want to use "TemplateUrl" in the component to render the cshtml content. In few cases, cshtml will have dynamic content and don't want an additional http request made.
Thanks in advance.
Thats right what Usman told you. At Angular 2/4 your App structure is completly new. You got a Template which is controlled by the #Component, where is linked with the attribute: 'template: "Page.html"'. There is also the templateURL Which is also an attribute of #Component. Use this if you want to specify your templateURL in your Typescript File. And another thing: Your Scope has changed a bit so think about it if you try to call javascript code in your template.
hope it helped.
There is no ng-controllers in Angular 2/4. You have components (kind of, but not exactly, controllers in AngularJs). There is no clean way of using server side views with Angular 2/4 unless you want to use server side rendering of Javascript using nodejs.
Have a look at this post https://blogs.msdn.microsoft.com/webdev/2017/02/14/building-single-page-applications-on-asp-net-core-with-javascriptservices/
This is based on Microsoft's JavaScript services library which does server side compilation for cshtml files. Steve Sanderson has a nice post (though a bit older now) about setting up Angular with ASP.NET
hope this helps.

TypeScript in MVC

Im bulding a website using MVC4. Recently I've read about TypeScript. It looks really nice however I cannot find any use for it in a MVC website. Am I missing something? Do you use it? Where?
TypeScript is a pre-compiler for JavaScript. Hence you can use TypeScript only as a replacement for JavaScript (server-side, e.g. Node.js, or client-side, i.e. in the browser).
As you are probably writing MVC4 code with C#, TypeScript will be of no use for you in relation to MVC4.
Regarding the client-side it's somewhat different.
I guess the main point you need to know is that TypeScript is not (yet) just another language on the server, that you can exchange with C#.
I find it quite useful for building largish apps with lots of logic on the client. The interfaces help avoid some errors. It compiles to javascript so you could use it instead of javascript. If you're just writing a couple of lines I wouldn't bother though.
You can link to the generated javascript files from TS files directly in the script bundles or HTML. If you want to automatically link to many JS files, use require JS. This will save you having to link to many js files.

Grails JQGrid 4.0

This problem also concerns my question regarding the multiple grouping inside the JQGrid using the <jqgrid:grid> tag. But as I later found out here in the changelog of JQGrid, there might be issues with the grouping feature of JQGrid version 3.8.0. I've tried using the scripting format of JQGrid presented here
So in theory, I would download JQGrid 4.0 and use it in the concerned project.
The question is how can I use the downloaded JQGrid 4.0 files to my project.
In the case that you can't find a Grails plugin that uses the version of jqGrid that you need, you could go the more direct route of downloading jqGrid.
Just put the js file in the webapps/js folder of your grails project and then include the source on whatever gsp pages you need. You wouldn't get whatever ease of use you get from the Grails plugin, but if you absolutely need the newest version of jqGrid without waiting for a Grails plugin update, then there ya go.

How can i compile the js file in asp.net mvc or asp.net?

Is it possible to compile the js file in asp.net or asp.net mvc like to support server side variables for example globalization or any other variables?
You may take a look at RazorJs. It also has a NuGet package available.
Spark View Engine supports this and actually works very well for this.
It allows you to use ~/ in your resource files URLs and translates it to the site root.
http://sparkviewengine.com/
Otherwise you could just write a Controller action that parses (and maybe compresses) those resource files for you. This can be made easy by using something like Packer.

How can I change jslint(VS 2010 extension) to ignore files?

I have js lint installed in Vs 2010 as a extension through the extension manager.
It finds lots of errors but they are all from external plugins or from the jquery library. I am not going to go and fix stuff in an external plugin or jquery file. So how can I get it to not check these files?
I am also wondering how can I get it to ignore checking href links. I am using asp.net mvc so my links are like this
reg
So it can't find this path as it is the path to the controller action method not a file. So how can I get it to not look at these?
Thanks
You can exclude files (external plugins, jquery, etc.) from the JSLint validation process.
From here.
For the href issue, if you don't have any JS in your views, you could exclude those as well using the method above.

Resources