Esempio n. 1
0
        private void AddTemplateBundles(BundleCollection bundles)
        {
            var templateBundle   = new AngularTemplateBundle(SharedRouteLibrary.Js.AngularModuleName, SharedRouteLibrary.Js.Templates);
            var uiComponentsPath = SharedRouteLibrary.Js.Bundle(AngularJsDirectoryLibrary.UIComponents + "/");

            templateBundle.IncludeDirectory(uiComponentsPath, "*.html", true);

            var uiComponentsAlternatePath = GetAlternateResourcePath(uiComponentsPath);

            if (HostingEnvironment.VirtualPathProvider.DirectoryExists(uiComponentsAlternatePath))
            {
                templateBundle.IncludeDirectory(uiComponentsAlternatePath, "*.html", true);
            }

            bundles.Add(templateBundle);
        }
Esempio n. 2
0
        /// <summary>
        /// Adds a bundle  to the collection containing angular html template files.
        /// </summary>
        /// <param name="jsRoutes">The ModuleJsRouteLibrary for this module</param>
        /// <param name="directories">A collection of directory names (no slashes) to scan for files and addto the bundle.</param>
        /// <returns>BundleCollection instance for chaining</returns>
        public static BundleCollection AddAngularTemplateBundle(this BundleCollection bundles, ModuleJsRouteLibrary jsRoutes, params string[] directories)
        {
            var bundle = new AngularTemplateBundle(jsRoutes.AngularModuleName, jsRoutes.Templates);

            foreach (var directory in directories)
            {
                var path = jsRoutes.JsFolderFile(directory + "/");
                if (HostingEnvironment.VirtualPathProvider.DirectoryExists(path))
                {
                    bundle.IncludeDirectory(path, "*.html", true);
                }
            }

            bundles.Add(bundle);

            return(bundles);
        }