Feed aggregator
Webix not working with Vue2
I am adding some Vue2 components to an existing page that uses webix, but that is breaking my webix components.
If I comment this line out , webix works as expected. When app-provider-ui.js is included on the page, webix datatables render, but nothing happens when I click on them.
I use Laravel 5.4, Vue2, and webpack. The Vue instance is mounted on #provider-js-app
Thanks.
<!DOCTYPE html> <html lang="en"> <head> <link href="{{ asset('/css/stylesheet.css') }}" rel="stylesheet"> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script> <script src="{{ asset('/webix/codebase/webix.js') }}" type="text/javascript"></script> </head> <body> <div id="provider-js-app"> @yield('content') <open-modal></open-modal> <notifications></notifications> </div> @include('partials.footer') <!--[if lt IE 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> <script src="{{ asset('/js/bootstrap-select.min.js') }}"></script> <script src="{{ asset('/js/typeahead.bundle.js') }}"></script> <script src="{{asset('/js/bootstrap.min.js')}}"></script> <script src="{{asset('/js/DateTimePicker.min.js')}}"></script> <script src="{{asset('js/app-provider-ui.js')}}"></script> </body> </html>vue js in bootstrap navbar
i am implementing vue js in bootstrap html template... problem i am facing is in navbar..
my code is
<router-link tag="li" to="#"> <a><i class="fa fa-book" aria-hidden="true"></i> <span class="nav-label">Syllabus</span><span class="fa arrow"></span></a> <ul class="nav nav-second-level collapse"> <router-link tag="li" to="/syllabus"> <a> Syllabus</a> </router-link> <router-link tag="li" to="/syllabus/topic"> <a>Syllabus Topic</a> </router-link> </ul> </router-link>i have also tried using
<li> <a><i class="fa fa-book" aria-hidden="true"></i> <span class="nav-label">Syllabus</span><span class="fa arrow"></span></a> <ul class="nav nav-second-level collapse"> <router-link tag="li" to="/syllabus"> <a> Syllabus 1</a> </router-link> <router-link tag="li" to="/syllabus/topic"> <a>Syllabus Topic</a> </router-link> </ul> </li>but the problem is when i am reloading the page the menu collapse and expands normally as it should work but when i am clicking on a a sub menu for instance "syllabus1" the page redirects to syllabus but the menu freezes and does not any longer collapse or expands...then again on reloading the menu starts working fine
please help me with this... thanks in advance... please provide an example in jsfiddle if possible... thankx..
Vue 2 add class active through exploring list
i have problem with input and lists, I would like to go through from input to list element below and add class 'active' to current li element
<div class="control"> <label class="label">Input Test</label> <input type="text" class="input" @keydown="keyHandler"> <ul> <li v-for="suggestion in suggestions" v-bind:class="{active}">{{suggestion.message}}</li> </ul> </div> methods : { keyHandler(e){ if(e.keyCode === 38){ e.preventDefault(); console.log('arrow up') this.currentKey = e.key } else if(e.keyCode === 40){ e.preventDefault(); console.log('arrow down') this.currentKey = e.key } } }here is fiddle: https://jsfiddle.net/o8fwf0gh/13/
I would be grateful for help
Passing data from parent to be rendered on component, data passage failure
I am trying to pass a first and last name to a child component to render as a custom element. Should be simple. But I am not able to link up my props for some reason. Here is the relevant parent code...
<div class="panel-body"> <full-name :userData.firstname="firstname" :userData.lastname="lastname"></full-name> </div> <script> import toggleSwitch from './components/toggleSwitch.vue'; export default { data () { return{ userData: { firstname: '', lastname: '' } } }, components: { 'fullName': fullName } } </script>As you can see I call the element and pass it my two data props. Once there I simply output my data via string interpolation, and... nothing shows. Here is my output component
<template> <div> <p>{{firstname}} {{lastname}}</p> </div> </template> <script> export default{ props: ['firstname', 'lastname'] } </script>Am I missing something obvious? Thanks in advance.
Vue.js raw HTML within attribute
Is there a way to output raw HTML to a tags attributes rather than content?
Example:
<input :placeholder="data.raw-html-message"/> ... data.raw-html-message = "some text…"v-html seems to only output it to the innerHTML of the tag and the triple curly braces have been removed in version 2.
Currently with a standard v-bind the output is:
<input placeholder="Message…" />
and the HTML entity is not interpreted when displayed in the browser.
vue-router same route with different param
I am on the /entry/12 route. On the same component I would like to push /entry/13 when user clicks the next button.
Code is like :
//e is the next page number. this.$router.push({ name: 'Entries', params: { pageNum: e }});I get below error:
If i try different route that works.
VueJS - v-if and v-show don't work properly
I have this structure inside Vue DIV:
<div class="row"> <div class="well chart-container"> <div id="chart" v-if="chartShown"></div> <h1 v-if="textShown">{{staticPropertyValue}}</h1> </div> </div>In my application I'd like to be able to display chart div OR h1 tag. Here's a part of my javaScript:
app.textShown = false; app.chartShown = true; if (data.length == 0) { MG.data_graphic({ title: "Missing Data", description: "", error: 'No data', chart_type: 'missing-data', missing_text: 'There is no data', target: '#chart', full_width: true, height: 600 }); return; }; if (data.length == 1) { app.staticPropertyValue = data[0].value; app.chartShown = false; app.textShown = true; return; } console.log('DRAWING GRAPH'); console.log(document.getElementById('chart')); MG.data_graphic({ title: "Fetched data", description: "", data: data, full_width: true, height: 600, target: '#chart', x_accessor: 'time', y_accessor: 'value' });So, depending on data.length property, the chart is shown or h1 tag is shown. The problem appears, when I first time call above code and display h1 tag (because data.length == 1) and then next time I call it with date.length > 1 (chart should appear). I get error:
The specified target element "#chart" could not be found in the page. The chart will not be rendered.
It is from the library that I'm using for drawing charts - metricsgraphics.js. So I console logged the result of
document.getElementById('chart')and it was null. So it means that although i switch chartShown to true, it's not done fast enough. How can I fix this?
I also tried using v-show instead of v-if - didn't work well - I had some errors about the width of some elements being NaN.
Vue router async route guard progress
I'm doing async work in my router's navigation guard:
router.beforeEach((to, from, next) => { somethingAsync().done(next) })Does the router expose anything to tell me that it's currently "loading"? Or do I need to keep track of it myself? Right now the content will pop up in<router-view></router-view> once the async work is completed. My current solution is to keep track of active work in my Vuex store and show a loading element next to the router view.
How to break v-for loop in vue.js?
I have this v-for loop an my vue.js app:
<div v-for="(word, index) in dictionary"> // break if index > 20 <p>{{word}}</p> </div>I want to break out of the loop after rendering 20 words. How can I achieve this? I looked at the docs but did not see anything about this.
How can I print source code in Vue.js
example:
<div id="app"> {{ message }} </div> var app = new Vue({ el: '#app', data: { message: 'Hello Vue!' } })How can I print source code '{{message}}' not 'Hello Vue!'
Mozilla releases research results: Zero rating is not serving as an on-ramp to the internet
Can digital literacy and Equal Rating solutions help connect the unconnected?
Today, 4 billion people live without the internet. There’s a global debate about how to connect the unconnected, but it’s often dominated by assumptions and not a lot of data or talking to actual users on the ground.
To better inform this issue, Mozilla recently supported a series of focus groups to investigate how and why people use subsidized services in India, Myanmar, Peru, Kenya, Nigeria, Rwanda and South Africa. Today, we’re releasing the results of this research carried out by Research ICT Africa, LIRNEasia and IEP.

Credit: Peter Cihon
Why do we care?
Many companies and organizations are working to connect the unconnected. For us at Mozilla, it is our mission to ensure the internet is a global public resource that’s open and accessible to all.
We’ve focused our work in this space on a concept we call Equal Rating. Building on Mozilla’s strong commitment to net neutrality, Equal Rating models are free of discrimination, gatekeepers, and pay-to-play schemes. Equal Rating stands in contrast to zero rating business models, which reduce the cost to zero only for some sites and services. We’ve pursued this through policy engagement with governments, an innovation challenge to catalyze new thinking in providing affordable access, and this research.
What did we ask?
- What barriers are keeping people offline?
- Is zero rating serving as an on-ramp to the internet?
- Why and how do people use subsidized services?
- Do people move beyond subsidized services, or do they just stay in the subsidized walled garden?
- How does use of subsidized services affect future internet usage?
What did we find?
Zero rating is not serving as an on-ramp to the internet
In all countries surveyed — excluding India where zero rating has been banned by the regulator — focus groups revealed that users are not coming online through zero rated services. While more research is needed, if zero rating is not actually serving as an on-ramp to bring people online, the benefits seem low, while the resulting risk of these offerings creating an anti-competitive environment is extremely high.
People use zero rating as one of many cost saving strategies
This research revealed that people who use zero rated services usually also have full access to the internet, and make use of zero rated and subsidized data services as one of many money-saving strategies, including:
- Use of multiple SIM cards cards to take advantage of promotions, better reception quality, or better prices for a given service.
- Use of public Wi-Fi. For example, many buses in Rwanda now provide wifi access, and participants reported being willing to wait for a bus that was Wi-Fi-enabled.
- Tethering to mobile hotspots. In South Africa and India, users not only share data but also promotions and subsidized offers from one phone to another.
- Earned reward applications (where users download, use, or share a promoted application in return for mobile data/credit). The research indicates that most users tend to play the system to get the most credit possible and then abandon the earned reward application.
- While users, especially in the African studies, report skepticism about whether zero rated promotions are truly free, partially subsidized bundles are popular. Notably, many of these offerings are Equal Rating compliant.
Some, particularly rural and low income users, are trapped in walled gardens
While zero rated services tend to be only part of internet usage for most users studied, some users are getting trapped in the walled gardens of these subsidized offerings.
- In particular, low income respondents in Peru and Rwanda use zero rated content for much of their browsing activity, as do rural respondents in Myanmar.
- Awareness matters: in Myanmar, respondents who know they are in a zero rated walled garden (e.g., due to lack of photos and video) are more likely to access the full internet beyond the walled garden.
- But, when Facebook is subsidized without impacting user experience, users tend to concentrate their usage on that single site, demonstrating concerns around the anti-competitive effects of zero rating.
Digital illiteracy limits access for connected and unconnected alike
Infrastructure and affordability are commonly cited barriers to internet access around the world; yet, this research also points to a third important barrier: digital literacy.
- Users and non-users alike do not understand all that the internet can offer.
- Users generally restrict their internet use to a few large websites and services.
- A lack of understanding about the internet and internet-connected devices exacerbates misconceptions and spreads fear around privacy, security, and health, which in turn undermines use of the internet. One Kenyan respondent said of non-users: “there are some assumptions that they can get diseases transmitted to them like skin cancer through the use of the internet.”
Many companies and NGOs are already doing great work to advance digital literacy, but we need to scale up these efforts.
Competition, literacy, language, and gender are also barriers to internet access
This research highlighted a series of consistent and persistent barriers to access.
- While 95% of the world has access to an internet signal, far too often, users have access to only one, low quality provider, usually the most expensive option in their country.
- Without basic literacy, some respondents cannot access the internet. As one respondent in rural South Africa said, “if you cannot read or write you cannot use internet, many people in this community are not educated and I believe most of them want to be able to use internet because it makes life easier.”
- Others in Myanmar, Peru, and Rwanda cite the lack of local language content and tools as keeping them from coming online.
- Evidence of a gendered digital divide is seen throughout all of the countries studied, with some women afraid of “breaking the machine” while others say social stigma, domestic abuse, negative impressions, and housework obligations limit their use of the internet.
These are just some of the highlights and interesting findings. We have results from nearly 80 focus groups in these seven countries. For more detailed information, the country summaries and full reports are available here.
Next steps to bring the next 4 billion online
Mozilla supported this research to help better inform what we believe is a global imperative to bring the world’s 4 billion unconnected people online to access the full and open internet.
Based on these findings, we believe the internet needs:
- The development of more Equal Rating compliant models, many of which seemed to be quite popular with research respondents and provide access to the full diversity of the open internet, not just some parts of it.
- Further investment in digital literacy training, especially in schools, on devices, and in retail outlets. For more information about Mozilla’s digital literacy efforts, see our recent Digital Skills Observatory study.
- Work on all barriers to access to address infrastructure investment especially in rural areas, affordability, local content and local language tools, and gender equality.
Bringing the full internet to all people is one of the great challenges of our time. While we know there is more research needed, this research better informs the global debate on how to connect the unconnected, and makes clear the challenges ahead. We are committed to tackling these challenges but we know it will take all of us — tech companies, telecom companies, governments, civil society groups and philanthropists — working together to get everyone online.
We’d like to thank the researchers at Research ICT Africa, LIRNEasia, and IEP, as well as Jochai Ben-Avie (who manages all our Equal Rating work) and Peter Cihon (our awesome summer intern) who helped analyze this research.
The post Mozilla releases research results: Zero rating is not serving as an on-ramp to the internet appeared first on The Mozilla Blog.
How to use JavaScript functions in Vue directives?
Assume I have a JS function like this:
function myFunc() { return true; }Now, I want to show an element if the output of is true:
<p v-if="myFun()">I am Test</p>I know I can write this myFunc method inside Vue methods but I don't want this.
Any idea would be great appreciated.
VueJS - Passing data from the created to mounted()
Is there a way to pass data from the created function to the mounted function in VueJS. I am building a VueJS application and my created function looks like this,
created: function(){ $.getJSON({ url: 'static/timeline.json', success:function(json) { return json; } }) }I want to pass the json value into vis.DataSet() of my mounted function which looks like this,
var items = {}; mounted(){ container = document.getElementById('mynetwork'); items = new vis.DataSet(json); }So, is there a way using which I can pass data from created to the mounted() function?
$router.push doesn't respect route meta fields
When using $router.push like so:
this.$router.push({name: 'Home'})... it seems my route meta fields aren't being recognised. Here's my route meta fields and how I'm calling them:
Route meta fields
router.beforeEach((to, from, next) => { if (to.matched.some(record => record.meta.requiresAuth)) { // this route requires auth, check if logged in // if not, redirect to login page. if (!auth.user.authenticated) { next({ path: '/login' }) } else { next() } } else { next() // make sure to always call next()! } }) router.beforeEach((to, from, next) => { if (to.matched.some(record => record.meta.preventAdmin)) { // this route shouldn't be available for admin, check role // if so, redirect to admin area. if (auth.user.role === '1') { next({ path: '/admin/users' }) } else { next() } } else { next() // make sure to always call next()! } })Routes
routes: [ { path: '/', name: 'Home', component: Home, meta: { requiresAuth: true, preventAdmin: true } }, ]If I refresh when I am on the particular route they work as intended.
Do I have to do something to ensure my route meta fields work when using $router.push?
Laravel blade Route with vue data
Here's the deal, I'm using blade and vue.js together on my Laravel app, and I need to build a url for my anchor tag... With blade only, what I would do was:
{{ Route('chef.menus.show', [$shop, $menu]) }}Since my route is
Route::get('/lojas/{shop}/cardapios/{menu}', 'MenuController@show') ->name('chef.menus.show');But, since I'm not using blade @foreach to render my links, and I'm using v-for. What is the best way to build a url from a Route name (if it is possible) inside here:
<tr v-for="menu in menus"> <td>@{{ menu.id }}</td> <td><a href="**URL GOES HERE**">@{{ menu.name }}</a></td> <td>@{{ menu.items.length }}</td> <td> <a href="#"><i class="material-icons md-16">delete</i></a> <a href="#"><i class="material-icons md-16">edit</i></a> </td> </tr>Keep in mind that I need to pass {{$shop}} (from PHP) and @{{ menu.slug }} from vue.js to correctly build my url :(
I appreciate any help! Thank you very much
Making custom controls in vueJS
I am exploring custom controls in VueJS. I have a simple on/off box in it's own component. The behavior I want is that on click a data property will will change. What I have is my component being passed a boolean value from its parent, and onclick this boolean should be updated via the switchIt() method
Child Component
<template> <div> <div id="on" @click="switchIt(true)" :class="{active: dataSwitch}">On</div> <div id="off" @click="switchIt(false)" :class="{active: !dataSwitch}">Off</div> </div> </template> <script type="text/javascript"> export default{ methods: { switchIt(){ this.$emit('input', isOn) } }, props: ['dataSwitch'] } </script>As you can see in the following parent I am passing my prop to my custom element and am then listening for the even emitted by my method in its child component.
Parent Component
<template> <div id="app"> <div class="container-fluid"> <form> <div class="row"> <div class="col-sm-12 col-md-6 col-md-offset-3"> <app-toggle-box v-model="dataSwitch" :dataSwitch="dataSwitch" @></app-toggle-box> </div> </div> </form> <h3>{{dataSwitch}}</h3> </div> </div> </template> <script> import toggleBox from './components/toggleBox.vue'; export default{ data () { return { dataSwitch: true } }, components: { appToggleBox: toggleBox } } </script>The problem is that my on box is highlighted and I cant selec my off box. I see no update occurring via string interpolation in my DOM and my styles dont change as I have set up.
Also getting this error on click
ReferenceError: isOn is not defined
Vue 2 - how to access computed within method
I want to loop through an array containing objects and grab a list of author names from these objects.
To do this I want to write a method which I will forEach() through. But I can't seem to access my computed property containing the array, when I console.log(articles) or console.log(this.newsFeed) it returns undefined or is just blank.
Clearly I'm doing something wrong but I don't understand what...
Here is my code:
new Vue({ el: '#feed', data: { newsFeed: "", }, created: function() { console.log('running'); this.getData(); this.filterAuthors(); }, computed: { articles: function() { var articles = this.newsFeed.articles; return articles; }, }, methods: { getData: function() { var newsFeed = this.$http.get('https://newsapi.org/v1/articles?source=the-next-web&sortby=latest&apikey='+ apikey).then(response => { this.newsFeed = response.body; }, response => { console.error(error); }); }, filterAuthors: function() { var articles = this.newsFeed.articles; var authorsArray = []; console.log(articles); // commented out while troubleshooting above // articles.forEach(function(article) { // // var authors = article.author; // // authorsArray.push(authors); // console.log(authors); // }); // return authorsArray; } } });Import a node module in Vue.js CLI instance
I've created a new vue app using vue init webpack sample-app .
I'm trying to import this module (https://docs.botui.org/install.html) into my app.vue and make it show on.
What's the correct way to import this module into a Vue.JS app?
How to write qunit test for the on-change event of a dropdown?
I have a Jsp file with following code:
<fieldset class="cd"> <label class="select icon icon-toggle180" v-bind:for="'DropdownList'"> <select id="Dropdown" v-bind:name="'Dropdown'" v-bind:id="'Dropdown'" v-on:change="DropdownListChanged($event, 'DropdownChanged')"> <option>Select</option> <option>Option 1</option> <option>Option 2</option> </select> </label> </fieldset>The Javascript file uses vue.js.It has a following function definition for DropdownListChanged()
DropdownListChanged: function (e, type) { if ((e.target.value != "" || e.target.value !="Select") && e.target.value == "Option 1") { this.policy = "A"; } if ((e.target.value != "" || e.target.value !="Select") && e.target.value == "Option 2") { this.policy= "B"; } }Now I want to write qunit test to test this javascript function. But I am not sure how should I mock the $event object and test the function.
download file that is currently on memory stream
I am trying to dowload a file that is on a memory stream. I am working with openxml, and at the moment i build the document doing some appends where i add tables paragraphs and other stuffs, not really important for the question, it is just important to say that in the end i can get a document on the server, it is getting saved in a folder called files.
The thing is, i want to try to download the file on the client side this time, i don't know very well if i am doing something wrong on the client side or on the server.
So basicly on the server i do it like this:
public FileResult Create([FromBody]AppDocument document) { if (!ModelState.IsValid) { //return BadRequest(ModelState); } var stream = new MemoryStream(); if(document.documentSelection == "Test Case Specification") { stream = testSpecificationDoc(document); } var bytesArray = stream.ToArray(); FileResult fileResult = new FileContentResult(bytesArray, "application/octet-stream"); fileResult.FileDownloadName = $"test4.docx"; HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK); result.Content = new StreamContent(stream); result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); return fileResult; } private MemoryStream testSpecificationDoc(AppDocument document) { String disclaimerTxt = "blabla." String date = "DD Month YYYY"; // document permission title DocRun accessTypeTitle = new DocRun(); Run permissionTitle = accessTypeTitle.createParagraph("DOCUMENT ACCESS", PARAGRAPHCOLOR,SMALLFONTSIZE,DEFAULTFONT); // document permission (ex: public, internal use only), defined on template side DocRun accessTypePermission = new DocRun(); Run permission = accessTypePermission.createParagraph(document.documentAccess, PARAGRAPHTITLECOLOR, SMALLFONTSIZE, DEFAULTFONT); DocRun disclaimerTitle = new DocRun(); Run disclaimerTitleTxt = disclaimerTitle.createParagraph("DISCLAIMER", PARAGRAPHCOLOR, SMALLFONTSIZE, DEFAULTFONT); DocRun disclaimerDescription = new DocRun(); Run disclaimerDescriptionTxt = disclaimerDescription.createParagraph(disclaimerTxt, PARAGRAPHTITLECOLOR, SMALLFONTSIZE, DEFAULTFONT); DocRun documentType = new DocRun(); Run documentTypeTxt = disclaimerDescription.createParagraph(document.documentSelection, TITLECOLOR, DOCTITLE, FONTTYPETITLE); DocRun projectNameTitle = new DocRun(); Run projectNameTxt = disclaimerDescription.createParagraph(document.projectName, SUBTITLECOLOR, FONTSIZESUBTITLE,FONTTYPE); DocRun dateParagraph = new DocRun(); Run dateTxt = disclaimerDescription.createParagraph(date, PARAGRAPHTITLECOLOR, DATEFONTSIZE, DEFAULTFONT); /*Doc simpleDoc = new Doc(); simpleDoc.CreateDoc(dateTxt, projectNameTxt);*/ var stream = new MemoryStream(); using (WordprocessingDocument doc = WordprocessingDocument.Create(stream, WordprocessingDocumentType.Document, true)) { MainDocumentPart mainPart = doc.AddMainDocumentPart(); String clientLogoPath = getCustomerLogo(document.projectName); PageMargin pageMargins = new PageMargin(); pageMargins.Left = MathOpenXml.convertUInt32ValueToDxa(DEFAULTLEFTMARGIN); pageMargins.Right = MathOpenXml.convertUInt32ValueToDxa(DEFAULTRIGHTMARGIN); pageMargins.Bottom = MathOpenXml.convertInt32ValueToDxa(DEFAULTBOTTOMMARGIN); pageMargins.Top = MathOpenXml.convertInt32ValueToDxa(DEFAULTTOPTMARGIN); //Important needed to access properties (sections) to set values for all elements. SectionProperties sectionProps = new SectionProperties(); sectionProps.Append(pageMargins); // Logo company construction DocImage companyLogo = new DocImage(); Run imageLogo = companyLogo.imageCreator(mainPart,COMPANYLOGOPATH,COMPANYIMAGENAME,COMPANYLOGOWIDTH,COMPANYLOGOHEIGHT,COMPANYIMAGEALING,null,null,"Square"); DocImage titleShape = new DocImage(); Run imageShape = titleShape.imageCreator(mainPart, SHAPEIMAGEPATH, TITLESHAPEIMAGENAME, TITLESHAPEWIDTH, TITLESHAPEHEIGHT, SHAPEIMAGEALING,null,0.24,"Behind Text"); DocImage clientImage = new DocImage(); Run clientLogo = clientImage.imageCreatorUrl(mainPart, SHAPEIMAGEPATH, TITLESHAPEIMAGENAME, TITLESHAPEWIDTHCLIENTLOGO, TITLESHAPEHEIGHTCLIENTLOGO, CLIENTIMAGEALIGN,clientLogoPath,1.1,null, "Top and bottom"); new Document(new Body()).Save(mainPart); Body body = mainPart.Document.Body; body.Append(sectionProps); body.Append(new Paragraph(new ParagraphProperties(new Indentation() { Start = MathOpenXml.convertUInt32ValueToDxa(DEFAULTLEFTIDENT).ToString() }), new Run(imageLogo))); body.Append(new Paragraph( new Run( new Run(new Break())))); body.Append(new Paragraph( new Run( new Run(new Break())))); body.Append(new Paragraph( new Run( new Run(new Break())))); body.Append(new Paragraph( new Run( new Run(new Break())))); body.Append(new Paragraph( new Run(imageShape))); body.Append(new Paragraph(new ParagraphProperties(new Indentation() { Start = MathOpenXml.convertUInt32ValueToDxa(DEFAULTLEFTIDENT).ToString() }), new Run(documentTypeTxt))); body.Append(new Paragraph( new Run( new Run(new Break())))); body.Append(new Paragraph(new ParagraphProperties(new Indentation() { Start = MathOpenXml.convertUInt32ValueToDxa(DEFAULTLEFTIDENT).ToString() }), new Run(projectNameTxt))); body.Append(new Paragraph(new ParagraphProperties(new Indentation() { Start = MathOpenXml.convertUInt32ValueToDxa(DEFAULTLEFTIDENT).ToString() }), new Run(dateTxt))); body.Append(new Paragraph( new Run( new Run(new Break())))); body.Append(new Paragraph( new Run( new Run(new Break())))); body.Append(new Paragraph(new ParagraphProperties(new Indentation() { Start = MathOpenXml.convertUInt32ValueToDxa(DEFAULTLEFTIDENT).ToString() }), new Run(clientLogo))); body.Append(new Paragraph( new Run( new Run(new Break())))); body.Append(new Paragraph(new ParagraphProperties(new Indentation() { Start = MathOpenXml.convertUInt32ValueToDxa(DEFAULTLEFTIDENT).ToString() }, new SpacingBetweenLines() { Line = "350", LineRule = LineSpacingRuleValues.Auto, Before = "0", After = "0" }))); body.Append(new Paragraph(new ParagraphProperties(new Indentation() { Start = MathOpenXml.convertUInt32ValueToDxa(DEFAULTLEFTIDENT).ToString() }, new SpacingBetweenLines() { Line = "350", LineRule = LineSpacingRuleValues.Auto, Before = "0", After = "0" }), new Run(permissionTitle))); body.Append(new Paragraph(new ParagraphProperties(new Indentation() { Start = MathOpenXml.convertUInt32ValueToDxa(DEFAULTLEFTIDENT).ToString() }, new SpacingBetweenLines() { Line = "700", LineRule = LineSpacingRuleValues.Auto, Before = "0", After = "0" }), new Run(permission))); body.Append(new Paragraph(new ParagraphProperties(new Indentation() { Start = MathOpenXml.convertUInt32ValueToDxa(DEFAULTLEFTIDENT).ToString() }, new SpacingBetweenLines() { Line = "350", LineRule = LineSpacingRuleValues.Auto, Before = "0", After = "0" }), new Run(disclaimerTitleTxt))); body.Append(new Paragraph(new ParagraphProperties(new Indentation() { Start = MathOpenXml.convertUInt32ValueToDxa(DEFAULTLEFTIDENT).ToString() }), new Run(disclaimerDescriptionTxt))); mainPart.Document.Save(); } stream.Seek(0, SeekOrigin.Begin); Directory.CreateDirectory(HostingEnvironment.MapPath(DOCUMENTSLOCATION)); System.IO.File.WriteAllBytes(HostingEnvironment.MapPath("~/Files/test5.docx"), stream.ToArray()); return stream; }on the client side i try to do something with the response, i want to prompt a dialog that gives the user the permission to download the file
let blob = new Blob([response.blob()], {type: response.headers['content-type']}), filename = (response.headers['Content-Disposition'] || '').split('filename=')[1]; result = document.createElement('a'); result.href = window.URL.createObjectURL(blob); result.download = filename; return result;i tried to check the result, i get a empty header, any help? am i doing it correctly?