Download persice i18n locale in Angularjs using Bower - angularjs

I'm using Wiredep tool with Gulp, to inject into my index.html on the run everything that I install using Bower. I don't want to download all the files listed here.
Is there a way to download only precise locale?
I've tried
bower install angular-i18n/angular-locale_uk-ua.js
And I got
fatal: remote error:
Repository not found.

In order to do this angular/bower-angular-i18n repo should be forked.
If the concern is to lower bower_components footprint on server side, postinstall hook can be supplied in .bowerrc to delete extra files from the package after installation.

Related

No `package.json` file found. Make sure you are running the command in a Node.js project

I am building a AngularJS file with typescript and installed tsd for typedefinitions globally. When I try to run the following command on the root of my project folder I am getting an error
I am new Angular JS using version 1.7. I am not sure if Package.json is needed for AngularJS project
Command
tsd install angular --resolve --save
Error
No package.json file found. Make sure you are running the command in a Node.js project.
package.json is required for node projects to specify metadata about project and include some important commands that may be required for the project build. First you have to install node from official website. You can google for the step by step installation. Once installed, goto your project directory and run this command. Make sure to perform "npm init" before you run the desired angular command.
Note: Ensure, node is accessible through cli
tsd is deprecated use #types node modules
npm i #types/angular --save

How should I include aws-appsync in AngularJS project

I am working on a AngularJS project that uses bower as package manager and gulp to inject the dependencies into the index.html file. I am not very familiar with both of these tools.
I now want to use AWS AppSync, but it is not available as a bower package.
Currently the AWS SDK is specified as a file dependency in bower.json as:
"aws-sdk": "./thirdparty/script/aws-sdk-2.69.0.min.js",
When I install aws-appsync with npm npm install aws-appsync the node_modules folder for aws-appsync contains multiple js files in the lib directory.
How can I include these with bower or is there another way to do this altogether?
I am currently unable to change much of the build and dependency management process so any suggestions working with the current tools would be much appreciated.
Thanks for reaching out!
The Bower team itself has recommended that people migrate to npm or yarn, and so aws-appsync has not been pushed to Bower.
It might be worth investigating whether you can install directly from github using something like...
bower install <github url>.git
... and install directly from the appsync-sdk github repo.
In the end I hacked together an interim solution until I can move the whole project over to npm and browserify.
I added the aws-appsync package using npm and required it in a new file. This file is then passed through a gulp task that uses the browserify plugin. The added file is then included into the rest of the build process as before.

Angularjs not rendering

I downloaded a sample Angular app from
https://github.com/angular/material-start
When I open the index file I just get raw Angular syntax and the pages are not showing correctly.
How can I fix this?
You need to run bower to get your dependencies. Just downloading the repo is not enough.
http://bower.io/
Install bower, the in your repo run a bower init
You should see it grab Angular and other items needed.
You need to do the following command in the root directory of your git clone:
npm install
This does a bower install also. You need npm installed (packaged with nodejs)

Package dependencies in NPM and Bower

First time user of npm and bower. I am able to install packages correctly but I am not sure how the dependencies work? As an example, I did "npm install angularjs" in my application root which created a folder "node_modules/angularjs/" with some files in it. I can also see that there is a package.json file within the angularjs folder, and it looks like it has not been processed as there is numerous packages listed in it and not installed.
Long story short, should I install all these packages manually or is there a built in feature that npm/bower can also process these sets of dependencies?
UPDATE:
I greatly lack the ability to ask precise questions, I apologise to those who have answered and did not give the correct sypnosis.
What I expect to happen:
Using npm or bower, I want to clarify that if I do an install of one of their packages, will it automatically also install the new package's dependancies or would I need to do a npm/bower install for each of the packages.json or bower.json files manually?
What I did to try make it work:
Created folder D:\Websites\TestSite
Within the folder through CMD, I did a "npm init" and ran through the guide
I followed that up with a "npm install angularjs"
A new folder was created D:\Websites\TestSite\node_modules\angularjs and within this folder there was a "index.js" and package.json file
Opening index.js I get a "require("angular");" and module.exports = window.angular.
The package.json file contains a number of dependancies which has not been installed.
My Result:
As per my expectations, npm install in point 3 above did not install the dependancies of the package.json file after it installed angularjs.
I am not sure but I assume that the index.js file needs to be included in my html and that it required the requirejs library initiated? If this is the case, then requirejs (which I do not have installed on my site) should be a dependancy for angularjs to work, and should be installed prior to giving me the ability to try and initiate it?
Am I missing a step or misunderstanding the functionality of NPM/Bower? Thank you for your patience!
Npm and Bower are great tools for managing your dependencies, i'll try to make it clear in a few words.
In general npm is used for managing your back-end dependencies and Bower is responsible for your front end dependencies.
There are 2 config files:
package.json, here are listed your dependencies that are not used in browser(e.g. bower, grunt). To install all dependencies in package.json run npm install.
Bower.json, here will be listed your "in browser" dependencies(e.g angular, jQuery). Run bower install to install all dependencies listed here in bower_components
You can find a extended guide i wrote here.

How do I reference angular-latest installed by bower?

I have installed AngularJS using bower, by calling:
$ bower install angular-latest
Now I wonder how to integrate AngularJS into my html file. Apparently, there is neither an angular[.min].js file nor an index.js file as suggested by the bower documentation.
I can't imagine that I am the first person on earth to discover this problem, but unfortunately I did not find any clues on this on Google (but perhaps I only used the wrong terms for searching).
Any idea of how to include AngularJS?
Okay, I found the solution:
$ bower install angular
And everything is fine ...
What you installed with
$ bower install angular-latest
was only the latest source code. You need to actually build AngularJS.
First, you need to install all of the following dependencies if you haven't already:
Git
Node.js
Java
Grunt
Bower
Second, change into the angular.js directory.
Then, install node.js dependencies and bower components:
$ npm install
$ bower install
Finally, you're ready to build your package:
$ grunt package
In the resulting build directory, you'll find
angular.js — The non-minified angular script
angular.min.js — The minified angular script

Resources