<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic MVC5 and typescript with hosted files in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mvc5-and-typescript-with-hosted-files/m-p/647065#M60285</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hopefully this helps someone else but here's how we setup ESRI javascript API within our MVC 5 that is also written in typescript and where we are hosting the ESRI files&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;lt;script&amp;gt; //see also: https://developers.arcgis.com/javascript/3/jshelp/inside_web_optimizer.html#use&lt;BR /&gt; define = undefined;&lt;/P&gt;&lt;P&gt;var dojoConfig = {&lt;BR /&gt; packages: [&lt;/P&gt;&lt;P&gt;/////////////////////////any non GIS modules used in GIS.ts need to be defined here/////////////////////&lt;BR /&gt; {&lt;BR /&gt; name: "GIS",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/GIS"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "collections",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/collections"&lt;BR /&gt; },&lt;BR /&gt; ////////////////////////////////////////&lt;/P&gt;&lt;P&gt;/////////////////////////////need this imports for GIS/////////////////////////////////////&lt;BR /&gt; {&lt;BR /&gt; name: "dojo",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/dojo"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "dojox",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/dojox"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "dijit",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/dijit"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "esri",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/esri"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "dgrid",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/dgrid"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "dgrid1",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/dgrid1"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "moment",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/moment"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "dstore",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/dstore"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "put-selector",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/put-selector"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "xstyle",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/xstyle"&lt;BR /&gt; },&lt;BR /&gt; /////////////////////////////////////////////////////////////////////&lt;BR /&gt; ],&lt;BR /&gt; async: true&lt;BR /&gt; };&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script src="@(Url.Content("~/Scripts/app/dojo/dojo.js"))" data-dojo-config="async: true"&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;/P&gt;&lt;P&gt;$(function() {&lt;BR /&gt; var gisModule;&lt;/P&gt;&lt;P&gt;require(["GIS/GIS"],&lt;BR /&gt; function(GIS) {&lt;BR /&gt; gisModule = new GIS("@(JsonConvert.SerializeObject(gisViewData))");&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;@(refreshFilter) = function(filterSequence) {&lt;BR /&gt; console.log("refresh function javascript");&lt;BR /&gt; gisModule.LoadFilterAssets(filterSequence);&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;link rel="stylesheet" type="text/css" href="@Url.Content("~/Scripts/app")/dijit/themes/claro/claro.css" /&amp;gt;&lt;BR /&gt;&amp;lt;link rel="stylesheet" type="text/css" href="@Url.Content("~/Scripts/app")/esri/css/esri.css" /&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we downloaded the argis javascript API and dumped the contents into Scripts/app&lt;/P&gt;&lt;P&gt;we stored our typescript typings in Scripts/typings; You have to go and get the typings for dojo, digit, dstore, etc. The typings for arcgis are &lt;A href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/arcgis-js-api/v3/index.d.ts"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/440116_pastedImage_5.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 21 Mar 2019 20:11:33 GMT</pubDate>
    <dc:creator>SallyMurdock</dc:creator>
    <dc:date>2019-03-21T20:11:33Z</dc:date>
    <item>
      <title>MVC5 and typescript with hosted files</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mvc5-and-typescript-with-hosted-files/m-p/647065#M60285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hopefully this helps someone else but here's how we setup ESRI javascript API within our MVC 5 that is also written in typescript and where we are hosting the ESRI files&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&amp;lt;script&amp;gt; //see also: https://developers.arcgis.com/javascript/3/jshelp/inside_web_optimizer.html#use&lt;BR /&gt; define = undefined;&lt;/P&gt;&lt;P&gt;var dojoConfig = {&lt;BR /&gt; packages: [&lt;/P&gt;&lt;P&gt;/////////////////////////any non GIS modules used in GIS.ts need to be defined here/////////////////////&lt;BR /&gt; {&lt;BR /&gt; name: "GIS",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/GIS"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "collections",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/collections"&lt;BR /&gt; },&lt;BR /&gt; ////////////////////////////////////////&lt;/P&gt;&lt;P&gt;/////////////////////////////need this imports for GIS/////////////////////////////////////&lt;BR /&gt; {&lt;BR /&gt; name: "dojo",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/dojo"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "dojox",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/dojox"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "dijit",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/dijit"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "esri",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/esri"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "dgrid",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/dgrid"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "dgrid1",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/dgrid1"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "moment",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/moment"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "dstore",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/dstore"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "put-selector",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/put-selector"&lt;BR /&gt; },&lt;BR /&gt; {&lt;BR /&gt; name: "xstyle",&lt;BR /&gt; location: location.pathname.replace(/\/[^/]+$/, "") + "/Scripts/app/xstyle"&lt;BR /&gt; },&lt;BR /&gt; /////////////////////////////////////////////////////////////////////&lt;BR /&gt; ],&lt;BR /&gt; async: true&lt;BR /&gt; };&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script src="@(Url.Content("~/Scripts/app/dojo/dojo.js"))" data-dojo-config="async: true"&amp;gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;script&amp;gt;&lt;/P&gt;&lt;P&gt;$(function() {&lt;BR /&gt; var gisModule;&lt;/P&gt;&lt;P&gt;require(["GIS/GIS"],&lt;BR /&gt; function(GIS) {&lt;BR /&gt; gisModule = new GIS("@(JsonConvert.SerializeObject(gisViewData))");&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;@(refreshFilter) = function(filterSequence) {&lt;BR /&gt; console.log("refresh function javascript");&lt;BR /&gt; gisModule.LoadFilterAssets(filterSequence);&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;/script&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;lt;link rel="stylesheet" type="text/css" href="@Url.Content("~/Scripts/app")/dijit/themes/claro/claro.css" /&amp;gt;&lt;BR /&gt;&amp;lt;link rel="stylesheet" type="text/css" href="@Url.Content("~/Scripts/app")/esri/css/esri.css" /&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we downloaded the argis javascript API and dumped the contents into Scripts/app&lt;/P&gt;&lt;P&gt;we stored our typescript typings in Scripts/typings; You have to go and get the typings for dojo, digit, dstore, etc. The typings for arcgis are &lt;A href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/arcgis-js-api/v3/index.d.ts"&gt;here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/440116_pastedImage_5.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 20:11:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/mvc5-and-typescript-with-hosted-files/m-p/647065#M60285</guid>
      <dc:creator>SallyMurdock</dc:creator>
      <dc:date>2019-03-21T20:11:33Z</dc:date>
    </item>
  </channel>
</rss>

