Answer the question
In order to leave comments, you need to log in
Why error in npm run dev for laravel?
}
npm ERR! code 1
npm ERR! path F:\OpenServer\domains\laravel\example-app
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sfwnh_89s4tn3\AppData\Roaming\npm-cache\_logs\2021-01-18T16_01_54_855Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ dev: `npm run development`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\sfwnh_89s4tn3\AppData\Roaming\npm-cache\_logs\2021-01-18T16_01_54_889Z-debug.log
Answer the question
In order to leave comments, you need to log in
Maybe naive, but did you do npm install from the project folder? After installing laravel.
It depends where you want to get it.
Judging by the name of the attribute, this is your AngularJS, so somewhere there must be a controller for which this piece of html is a template. You can search for scripts on the $scope.bonusInfo line.
If you need to get in jquery, then there is a .data() method;
It works like this:
$(element).data('ng-bind');
And how to display - it depends on where you want to display it.
var data = $("span").data();
alert(data.ngBind);
// или
alert($("span").data('ngBind'););
For OOP, I think it will be necessary to create a class describing the xml structure ( description ), specifically for this fragment, this class will look like this:
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.Serialization;
using System.Xml.Serialization;
[DataContract(Name = "span")]
public class Span
{
/// <summary>
///
/// </summary>
[XmlAttribute("class")]
public string VerticalInterval { get; set; }
/// <summary>
///
/// </summary>
[XmlAttribute("data-ng-bind")]
public string DataNgBind{ get; set; }
}
namespace Common
{
using System.IO;
using System.Xml.Serialization;
public static class Serialization
{
public static string SerializeToString(this object obj)
{
var xmlSerializer = new XmlSerializer(obj.GetType());
var stringWriter = new StringWriter();
xmlSerializer.Serialize(stringWriter, obj);
return stringWriter.ToString();
}
public static T DeserializeString<T>(this string sourceString)
{
var xmlSerializer = new XmlSerializer(typeof(T));
var stringReader = new StringReader(sourceString);
return (T)xmlSerializer.Deserialize(stringReader);
}
}
}
var _span = new Span();
_span.VerticalInterval = "vertical-interval-xsmall form-field-input";
_span.DataNgBind = "bonusInfo.bonusData.CardNumber";
// передаем в конструктор тип класса
XmlSerializer formatter = new XmlSerializer(_span.GetType());
using (FileStream fs = new FileStream("model.xml", FileMode.OpenOrCreate))
{
formatter.Serialize(fs, _span);
Console.WriteLine("Объект сериализован");
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question