- Update .angular-cli.json ( which is in root folder of your Angular2 application) for
- “styleExt”: “css” to “styleExt”: “scss”
- “styles”: [
] to “styles”: [
- Update the styles.scss in src folder ( create if does not exist) for adding lines
- @import “./assets/bootstrap-sass/variables”;
- Install bootstrap sass module npm install –save bootstrap-sass
- Copy _variables.scss file from node_modules/bootstrap-sass/assets/stylesheets/bootstrap to src/assets/bootstrap-sass folder.
- (Optional) Update the above file src/assets/bootstrap-sass/_variables.scss for bootstrap customization.
- Run ng serve to compile the Angular2 application and see the changes in browser.
You may need to update src/assets/bootstrap-sass/_variables.scss for fonts path,
$icon-font-path: if($bootstrap-sass-asset-helper, “bootstrap/”, “../fonts/bootstrap/”) !default;
$icon-font-path: if($bootstrap-sass-asset-helper, “bootstrap/”, “../node_modules/bootstrap-sass/assets/fonts/bootstrap/”) !default;
Getting Started with Angular2 and Bootstrap
# Install Angular2 Cli
npm install -g @angular/cli
# Create new application
ng new application-name
# Start serving application, see browser localhost:4200
# In src directory, install bootstrap using bower
bower install bootstrap –save
# Link bootstrap style to application, edit .angular-cli.json
# add new element to app->styles array
# Stop and again start serving the application and it is ready!
I will keep updating the post for more examples on these methods.
With context object,
First of all, create project on google cloud and enable big query api.
Usually we need to change directory/file permission to able to write files. This may be for uploads directory or code generation tool. But most of the time some developers do bad thing, that the give permission 777 to the directory/file and get work the done.
sudo chmod -R 777 /path/some-directory
Here the script which throws the write permission error, now executes smoothly as it has got the 777 permission. But here we compromised serious security risk. Permission 777 means that is read/write/execute to everybody in the system, thus creating loop hole for security.
Instead of assigning permission 777, we can assign 775 and add the user who runs the script(which thrown the permission error) in the user group of the directory/file.
Following command adds given user (userName) to particular group (groupName)
sudo usermod -a -G groupName userName
Above will add user which runs the script to the group of users of directory/file which need write permission. Here I am assuming that your directory/file already has write permission i.e. user group has writable permission. You can also check members of user group from file “/etc/group”.
For web applications where Apache is the web server, you can add “www-data” to group of users. For PHP yii framework you need to set writable permission to some directories while development so that code generators can work.
This was just to give alternative way(good) to the developer who quickly give 777 permission to avoid/fix permission error. There are many more things you need to care when you think from security aspect. Avoid globally write is surely one of them.
Happy coding 🙂
Reference : https://help.ubuntu.com/community/PostgreSQL
In a terminal, type:
sudo -u postgres psql postgres
Set a password for the “postgres” database role using the command:
# It will ask for new password and enter it and start using it :)
To install it from ppa,
sudo apt-add-repository ppa:cordova-ubuntu/ppa
sudo apt-get update
sudo apt-get install cordova-cli
npm install -g cordova
For more information about other installation methods can be found here, https://www.npmjs.com/package/cordova