I'd like to show an issue with my Angular code so I tried to create a fiddle for it. Since I wasn't sure how to link AngularJS package in (other than entering the whole URL, which I'm bound to fail on due to misspelling and laziness), I googled "how to easy link to angulaarjs in jsfiddle" and got a fiddle like this: jsfiddle.net/dakra/U3pVM/ (among many others).
The poster doesn't actually link to anything (except bootstraping the styles) and I'm not quite clear on why.
I'd like to know if that's the proper way to present an example when asking Angular related questions on StackOverflow. If not, what is?
As a secondary question, I'd like to know how to properly handle the fact that in my example locally, I'm using ng directives directly in html and body (for smaller examples) but JsFiddle explains that those tags, already being included, aren't going to work. Should I move those directives deeper into the markup structure?
Related
How can I view Multiple Page Source Code - all together in one set.
for example:
https://stackoverflow.com/
https://www.microsoft.com/
https://www.example.com/
Every URL of these has a page source, how can I view them all under/into one set?
Unfortunately, I don't know why this question got -1 vote.
however, the answer that I've found it might fit this question is that you can go to this link:
https://www.joydeepdeb.com/tools/view-source-code.html
Inside this link there's a useful tool might help other similar purposes.
This tool offers limited use, which means that, some URLs might not properly work, I think it is because the syntax of the URL must take a certain form/shape.
I have a website and need to transport a form to another website. I however only need certain tags not the whole form block with all it's tables and divs.
When selecting a html-tag in inspector, I can copy inner HTML, outer HTML or CSS styles but how can I just copy that very exact tag I selected without it's child nodes, just the selected line in HTML code?
I ask this because the HTML is minified and I can't just select and copy a tag in source. Same when I chose "copy outer HTML" I get the whole HTML subtree minified, means everything in one line.
How can I quickly search and copy certain tags from the three without grabbing everything in the branch?
Edit: People, thanks for all your suggestions but please note that I wrote about a MINIFIED HTML page I have here.
Just open Debugger near Inspector
Then find page file... then copy with any select range as you want
UPDATE
if it minify click here
If I understood what you want try this
Since your question seems unsolved yet, let me come up with a creative approach I use for similar tasks from time to time:
(1) Creative solution: Page manipulation
If you don't have a javascript framework of your choice (e.g. jQuery) on that page, add it using a browser-extension that adds it when page has loaded.
Then you write a bit of javascript code that removes unwanted child elements of the desired parents in a loop or so. That sounds like lots of work but since you asked this question I assume you need dozens if not hundreds of elements so it might be worth taking the time to write such loop(s).
When the code you injected processed the page and removed everything you don't want, you can then copy the code like mentioned by others here.
(2) Alternative solution: Beautify the code beforhand
If the given solution(s) don't work for you, one could try to beautify the code by copying the source to a webpage that auto-indends html/js code. You could then optionally save it into a html-file and approach that one again like mentioned here before.
Sidenote
If either this idea is too much work or you need this frequently you are probably approaching this on the wrong side. When working on frontend (only) you are always limited to what you have. If you could approach from the backend you could then build from the data/information whatever you need. If you could provide a bit more information about why you need this and how much code you are talking about one could maybe come up with a more sustainable solution!
My Vim level is about intermediate - I've been using it about 10 years, but on "newbie" level - find file, delete something, add something, save and quit.
Now I decided to make Vim my only code editor.
I'm working with Ionic framework (it's Angular + SCSS) and I have a question about some useful things:
Is there a way to add all non-standard HTML tag to Syntastic? It's highlights all of Ionic tags, such as <ion-list>, <ion-button>, <ion-radio> and so on. If my google skills are good enough, there's no full Ionic plugin, which will add snippets, syntastic checkers and so on.
Is there a way to find and add classes from HTML to SCSS and from SCSS to HTML? I mean, if I'll write .my-very-important-class in SCSS file and then go to HTML file (which is in the same directory with same name and differs by .html or .scss) and in class="" attribute start to input "my" I'll get autocomplete suggest for this class. Is it real to make or maybe someone did already?
There is also main file for theming an app, called variables.scss. I need this file to be scanned and match colors (in this file there is an color section, where I can put all colors, I'll need in app, and in .scss file of any page I can get color I need with just color: color($colors, colorname) where colorname is the name of color variable. It's awesome feature, except no color highlighting in code. So it would be great to get color mappings and then highlighting with correct color in .scss file of page.
I didn't found any plugins for this. If there some existing plugins I've missed - I'll be happy to try it. If it's no - I will be glad to made one myself (if it's not very hard). Anyway, I think this are useful things not just for me.
UPD: #1 was fixed - I'm not sure, how exactly, but now it's fine in HTML and I have no errors or warnings from syntastic about wrong tags. I'm feeling newbie, but seems like I forgot to install Vim-ionic2 plugin - just added it to my .vimrc.
And #2 seems to be answered - does what I need.
Syntastic is a frontend to several linters. Find the linter used by Syntastic and look for a way to make it accept those custom tags.
If you have the CSS file opened, <C-n> should let you complete the CSS class.
You might need something like set iskeyword+=- for Vim to complete the whole class name.
I think this would be totally useless. That said, if you didn't find such a thing… write it.
respect to the first point I'll say that vim for itself doesn't highlights all the HTML elements (main, header,etc) because the default html.vim file is a little outdated. However, I've just created a repository in which I added all the remaining elements to be highlighted.
If you encounter that something in the language you're working on doesn't get highlighted you should create a .vim file adding the keywords you want to be highlighted. I share you the repository I've talked about: github repo
It'll be nice that people can contribute so we don't have to create repeated vim files.
You can read more about syntax here: vimdocumentation
First off, I'd really recommend you split this into three separate questions. I feel like they could easily have dedicated answers that are not really connected. And someone might have a good suggestion for one of them, but not for the others. On my side, I can give you suggestions about 2) and 3) only.
For 2), you could use romainl's suggestion for completing keywords. You could also try generating tags for your CSS files using ctags. Here's one possible way to do it: https://github.com/rstacruz/ctags-css. Once you have the tags, you could use tag completion. See :help ins-completion, in particular the "tags" section. It would be a pretty good idea to read up the entire section, though, to get an overview of what's possible.
For 3), there's plugins around for this. Try this one: https://github.com/lilydjwg/colorizer
Often when I inspect the HTML code of a site have difficulty in finding out what file is part of a specific DIV.
For example if you inspect a CMS that has many files and modules I can not tell exactly where it is that div or a script JS.
If we inspect the site to find a JS code but do not know where it belongs.
Look at the picture below
http://i60.tinypic.com/2njln9f.jpg
I hope you have understood what I mean.
If it's not clear I will return with more information
Thanks in advance!
Unfortunately,
From web-inspector, it is not possible.
Because the browser only receives the combined html output.
But, You will be able to see all the javascript functions which have executed due to your actions. You can view them one by one to figure out which method has caused the mischief.
http://twitter.github.com/bootstrap/scaffolding.html
http://angularjs.org/#/list (the basics one)
Basically, I'm wondering what tools there are out there for me to create what they have there. The one I really like is he angularJS one, because I need a way to allow annotations within my code snippets.
So, basically. My question is this:
How did they create the annotations to work at certain places in the code (so you hover over the highlight), is that created from a library. If so, where is this library found? I found some online, but they all looked like terrible sticky notes, and I want something more stylish like this.
And finally, how do i get the line numbering to work?
Thank you.
Alex.